I’m trying to build a simple c application using gcc on aix
gcc -I. -c hello.c -o hello.o
gcc -o helloWorld hello.o -L helloHelper.so -ldl
I get the following errors
ld 0711-317 ERROR: Undefined symbol: .PrintHello
PrintHello is a method in the library helloHelper.
I can build the application in windows.
The option
-Lis for indicating directories where to search for libraries. To link a dynamic library directly, just put it in the linker command:Other option would be to use
-lhelloHelperbut then the library should be calledlibhelloHelper.so.