WinFF / winff

Automatically exported from code.google.com/p/winff
215 stars 49 forks source link

Error: (5002) Duplicate identifier "LAZUTF8" and "LAZFILEUTILS" #257

Closed thierry-FreeBSD closed 1 year ago

thierry-FreeBSD commented 1 year ago

Hello, Trying to compile winff-1.6.2 on FreeBSD fails with the hereunder error:

SetupCompilerFilename: Searching compiler ...
SearchCompilerCandidates Value=fpc File=/usr/local/bin/fpc
Hint: (lazarus) [RunTool] "/usr/local/bin/fpc" "-iWTOTP"
Hint: (lazarus) [RunTool] "/usr/local/bin/fpc" "-va" "compilertest.pas"
SetupCompilerFilename: using /usr/local/bin/fpc
Hint: (lazarus) storing Lazarus directory "/usr/local/share/lazarus-2.2.6/" Compiler path "/usr/local/bin/fpc" in "/usr/ports/multimedia/winff/work-gtk2/.lazarus/environmentoptions.xml"
TProject.DoLoadStateFile Statefile not found: /usr/ports/multimedia/winff/work-gtk2/winff-winff-1.6.2/winff/winff.compiled
Hint: (11030) Start of reading config file /usr/local/etc/fpc.cfg
Hint: (11031) End of reading config file /usr/local/etc/fpc.cfg
Free Pascal Compiler version 3.2.2 [2023/09/19] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Warning: (11053) The selected debug format is not supported on the current target, not changing the current setting
(1002) Target OS: FreeBSD for x86-64
(3104) Compiling winff.lpr
(3104) Compiling unit1.pas
/usr/ports/multimedia/winff/work-gtk2/winff-winff-1.6.2/winff/unit1.pas(32,50) Error: (5002) Duplicate identifier "LAZUTF8"
/usr/ports/multimedia/winff/work-gtk2/winff-winff-1.6.2/winff/unit1.pas(32,64) Error: (5002) Duplicate identifier "LAZFILEUTILS"
(3104) Compiling unit2.pas
/usr/ports/multimedia/winff/work-gtk2/winff-winff-1.6.2/winff/unit2.pas(100,1) Fatal: (10026) There were 2 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode
Error: (lazarus) Compile Project, Target: winff: stopped with exit code 1
Error: (lazbuild) failed compiling of project /usr/ports/multimedia/winff/work-gtk2/winff-winff-1.6.2/winff/winff.lpi
*** Error code 2

Remarks: 1) Actually the duplicate symbols are LazUTF8 and LazFileUtils; 2) Before trying to compile, I replaced {$ifdef linux} by {$ifdef unix}.

PeterBBBBB commented 1 year ago

How strange! The symbols are not duplicated in Linux or Windows. What happens if you replace line 32 with PoTranslator, types, FileUtil, regexpr {$IFDEF WINDOWS}, LazUTF8, LazFileUtils{$endif} {$IFDEF linux}, LazUTF8, LazFileUtils{$endif}; ?

thierry-FreeBSD commented 1 year ago

Strange, but with this patch it builds:

(1010) Writing Resource String Table file: unit2.rsj
(9022) Compiling resource /usr/ports/multimedia/winff/work-gtk2/winff-winff-1.6.2/winff/winff.or
(9015) Linking /usr/ports/multimedia/winff/work-gtk2/winff-winff-1.6.2/winff/winff
/usr/local/bin/ld.bfd: warning: /usr/local/lib/fpc/3.2.2/units/x86_64-freebsd/rtl/cprt0.o: missing .note.GNU-stack section implies executable stack
/usr/local/bin/ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
(1008) 7071 lines compiled, 3.7 sec
(1021) 96 warning(s) issued
(1022) 124 hint(s) issued
(1023) 1 note(s) issued
PeterBBBBB commented 1 year ago

Should be fixed in latest commit. Thanks for the report.