int main() { HelloWorld(); return 0; } For compiling the library, I have tried many of the FPC arguments listed here: https://www.freepascal.org/docs-html/user/userap1.html. It successfully compiles a libHelloWorldLib.a archive file. E.g.
fpc HelloWorldLib.lpr -B -CN -l -O2 -MobjFPC For compiling the C application I use the following command, and have tried multiple variations on this as well:
gcc -o hw helloworld.c -L. -lHelloWorldLib I receive the following error message: "ld: 0711-317 ERROR: Undefined symbol: .HelloWorld". If I use "g++" instead of "gcc", I get: "ld: 0711-317 ERROR: Undefined symbol: .HelloWorld()".
If I use "dump -HTv libHelloWorldLib.a", I get nothing, which seems to indicate that there are no symbols in the archive.
I'd appreciate any assistance that can be provided. Thanks!
Title: Re: 'Undefined Symbol' Error when consuming FPC library in C on AIX (powerpc64)
Post by: Phil on April 06, 2018, 06:35:18 pm