Sandeep Nagar
Sandeep Nagar

Reputation: 11

How to link *.so file in AIX with GCC compiler

I am trying to link a *.so file while compiling a C code using GCC compiler on AIX machine but could not do so. Using traditional -L and -l options, for path and .so library name respectively, gives "could not find error", setting LD_LIBRARY_PATH didn't help either. I understand that linking options are different in AIX. But I'm not able to comprehend the correct options.

Can you please answer my query with example.

Upvotes: 0

Views: 1273

Answers (1)

Zsigmond Lőrinczy
Zsigmond Lőrinczy

Reputation: 377

Use option -Wl,-brtl to be able to use *so* shared objects.

Edit (the first option is either -maix32 or -maix64 depending on the context):

gcc -maix32 -o example -Wl,-brtl example.c /var/tmp/lib/librequired.so

or

gcc -maix32 -o example -Wl,-brtl example.c -L/var/tmp/lib -lrequired

Upvotes: 1

Related Questions