How does the gcc linker choose / usr / lib versus / usr / lib64 to resolve the library?

My gcc link line includes the following two entries in a row:

-lrt
-lpam

And it looks extended like:

/usr/lib64/librt.so /usr/lib/libpam.so

Why is rt allowed by lib64, while pam is allowed by lib and therefore fails:

/usr/lib/libpam.so: could not read symbols: File in wrong format

Since this is only a 32-bit ELF. There is / usr / lib 64 / libpam.so with 64-bit ELF, why is this not accepted?

+5
source share
1 answer

Try using -m32 to force 32-bit. Also check out any vatiables environments that are installed by your .bashrc or .bash_profile that you are compiling to determine if something is cross-linked.

+1
source

All Articles