dmitrybv 3 Posted September 22 (edited) Good afternoon. I have created a library package for cross-platform work on Windows, Android, Linux, macOS, iOS. My package compiles and runs error-free on all platforms. But when I tried to compile the package for different platforms using the command-line compiler, I encountered compilation errors. Here is the result of the experiments ----Win32: Compilation via the RAD Studio IDE - No errors. Compilation via dcc32.exe C:\RADStudio\23.0\Bin\dcc32.exe -B -JPHNE -JL EhLib.Rtl.dpk … 316157 lines, 6.00 seconds, 2562852 bytes code, 3508 bytes data. No Errors. ----Win64: Compilation via the RAD Studio IDE - No errors. Compilation via dcc64.exe C:\RADStudio\23.0\Bin\dcc64.exe -$Y- -$L- -$D- -B -JPHNE -JL -NSData.Win;Bde;Vcl;Vcl.Imaging;Data;Winapi;System;System.Win;Datasnap;Xml;Xml.Win EhLib.Rtl.dpk No Errors. ---- Android64 Compilation via the RAD Studio IDE - No errors. Compilation via dccaarm64.exe C:\RADStudio\23.0\Bin\dccaarm64.exe -$Y- -$L- -$D- -B -NSData.Win;Bde;Vcl;Vcl.Imaging;Data;Winapi;System;System.Win;Datasnap;Xml;Xml.Win EhLib.Rtl.dpk No Errors. ---- Linux64 Compilation via the RAD Studio IDE - No errors. Compilation via dcclinux64.exe C:\RADStudio\23.0\Bin\dcclinux64.exe -$Y- -$L- -$D- -B -NSData.Win;Bde;Vcl;Vcl.Imaging;Data;Winapi;System;System.Win;Datasnap;Xml;Xml.Win EhLib.Rtl.dpk Embarcadero Delphi for Linux 64 bit compiler version 35.0 Copyright (c) 1983,2022 Embarcadero Technologies, Inc. Linker command line: C:\RADStudio\22.0\Bin\ld-linux.exe -o bplEhLib.Rtl280.so -e _ZN5Ehlib3Rtl14initializationEv --gc-sections --version-script EhLib.Rtl.vsr -shared --no-undefined --export-dynamic -z noexecstack -z relro --build-id --eh-frame-hdr -m elf_x86_64 --dynamic-linker /lib64/ld-linux-x86-64.so.2 -s @EhLib.Rtl.lnk -lgcc_s -lrtlhelper_PIC -lc -ldl -lpthread -lz -l:bplrtl280.so -l:bplxmlrtl280.so -l:bpldbrtl280.so -rpath $ORIGIN Error: E2597 C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find -lgcc_s C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find -lrtlhelper_PIC C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find -lc C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find -ldl C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find -lpthread C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find -lz C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find bplrtl280.so C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find bplxmlrtl280.so C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find bpldbrtl280.so c:\radstudio\22.0\lib\linux64\release\SysInit.o(.data+0x0): error: undefined reference to '__init_record_System' c:\radstudio\22.0\lib\linux64\release\SysInit.o:SysInit:function Sysinit::__malloc(NativeUInt): error: undefined reference to 'malloc' c:\radstudio\22.0\lib\linux64\release\SysInit.o:SysInit:function Sysinit::__free(void*): error: undefined reference to 'free' … C:\Users\Public\Documents\Embarcadero\Studio\22.0\Components\EhLib\Src\EhLib.Rtl.dpk.o:.EhLib.Rtl:_ZN5Ehlib3Rtl0E: error: undefined reference to 'Xml::Xmldoc::Finalization()' Fatal: F2588 Linker error code: 1 ($00000001) ---- OSX64 Compilation via the RAD Studio IDE - No errors. Compilation via dccosx64.exe C:\RADStudio\23.0\Bin\dccosx64.exe -$Y- -$L- -$D- -B NSData.Win;Bde;Vcl;Vcl.Imaging;Data;Winapi;System;System.Win;Datasnap;Xml;Xml.Win EhLib.Rtl.dpk Embarcadero Delphi for Mac OS X 64 bit compiler version 36.0 Copyright (c) 1983,2024 Embarcadero Technologies, Inc. Rtl\MemTableDataEh.pas(674) Warning: W1075 Overloading a similar index type by declaring an array property 'Items' + Rtl\MemTableDataEh.pas(674) Related member: property TOrderByList.Items[Integer]: TOrderByItemEh; + Rtl\MemTableDataEh.pas(674) Related member: property TObjectList.Items[NativeInt]: TObject; Linker command line: C:\RADStudio\23.0\bin\ld.exe -arch x86_64 -o bplEhLib.Rtl280.dylib -e __ZN5Ehlib3Rtl14initializationEv -dead_strip -dead_strip_dylibs -mark_dead_strippable_dylib -exported_symbols_list EhLib.Rtl.exp -dylib -export_dynamic -S -x -macosx_version_min 10.14 -rpath $ORIGIN -install_name @rpath/bplEhLib.Rtl280.dylib -filelist EhLib.Rtl.lnk Error: E2597 ld: warning: directory not found for option '-L/usr/lib' ld: warning: directory not found for option '-F/System/Library/Frameworks/' ld: file not found: librtlhelper.a Fatal: F2588 Linker error code: 1 ($00000001) ---- Result Thus, using parameters similar to dcc32, it is not possible to compile through programs dcclinux64.exe , dccosx64.exe . Is it necessary for dcclinux64.exe dccosx64.exe should I specify any additional parameters? Edited September 22 by dmitrybv Share this post Link to post
Remy Lebeau 1396 Posted September 23 Do you have the same problem if you use MSBuild instead of invoking the compilers directly? Building a Project Using an MSBuild Command Share this post Link to post
Kazantsev Alexey 24 Posted September 23 7 hours ago, dmitrybv said: Compilation via dcclinux64.exe You need to specify parameters --libpath and --syslibroot. Values can find in SDK Manager. Share this post Link to post
Pat Foley 51 Posted September 23 (edited) 11 hours ago, dmitrybv said: C:\RADStudio\23.0\Bin\dcclinux64.exe -$Y- -$L- -$D- -B -NSData.Win;Bde;Vcl;Vcl.Imaging;Data;Winapi;System;System.Win;Datasnap;Xml;Xml.Win EhLib.Rtl.dpk Embarcadero Delphi for Linux 64 bit compiler version 35.0 Copyright (c) 1983,2022 Embarcadero Technologies, Inc. Linker command line: C:\RADStudio\22.0\Bin\ld-linux.exe -o bplEhLib.Rtl280.so -e _ZN5Ehlib3Rtl14initializationEv --gc-sections --version-script EhLib.Rtl.vsr -shared --no-undefined --export-dynamic -z noexecstack -z relro --build-id --eh-frame-hdr -m elf_x86_64 --dynamic-linker /lib64/ld-linux-x86-64.so.2 -s @EhLib.Rtl.lnk -lgcc_s -lrtlhelper_PIC -lc -ldl -lpthread -lz -l:bplrtl280.so -l:bplxmlrtl280.so -l:bpldbrtl280.so -rpath $ORIGIN Error: E2597 C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find -lgcc_s C:\RADStudio\22.0\Bin\ld-linux.exe: error: cannot find -lrtlhelper_PIC 1. Read the "hints" on the error your compiling for "32" 64 with version 35.0 compiler switched to using a D11 path. I would say its a proj copied from d11 codebase to to a d12 codebase that kept the d11 proj guid. Edited September 23 by Pat Foley Crossed out "solution" Share this post Link to post