[fpc-devel]Linker errors when compiling a mixed C/C++ code tree.

Pascal Pype pascal.pype at skynet.be
Tue Jan 27 15:30:57 CET 2004


Hello,

When one tries to compile a mixed C/C++ - pascal code tree into a single
executable one gets the following linker errors :
 
1./usr/local/lib/fpc/1.0.10/units/freebsd/rtl/libpsysbsd.a(sysbsd0s283.o): 
     In function `_SYSBSD$$_SYSTEM_EXIT':
sysbsd0s283.o(.text+0x4): undefined reference to `_haltproc'
2./usr/local/lib/fpc/1.0.10/units/freebsd/rtl/libpsysbsd.a(sysbsd0s186.o): 
In function `FPC_FINALIZEUNITS':
sysbsd0s186.o(.text+0x8): undefined reference to `INITFINAL'

The linkage step is carried out via the command:

gcc -g ./../entities/cmdInterpret/lib/dbg/cmdinterpret.o 
./../entities/consoleCmd/lib/dbg/consoleCmd.o 
/usr/local/lib/fpc/1.0.10/units/freebsd/rtl/libpsysbsd.a 
./../utilities/mainEntryPnt/dbg/mainEntryPnt.a -o ./../dbg/lib

cmdinterpret.o is compiled from pascal source code as a unit
consoleCmd.o,mainEntryPnt.a are compiled from C/C++ source code
where the function main resides within the static library mainEntryPnt.a

P.S. The OS upon which this is compiled is FreeBSD release 4.9.

Regards , Pascal.





More information about the fpc-devel mailing list