[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


When one tries to compile a mixed C/C++ - pascal code tree into a single
executable one gets the following linker errors :
     In function `_SYSBSD$$_SYSTEM_EXIT':
sysbsd0s283.o(.text+0x4): undefined reference to `_haltproc'
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 
./../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