This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

linking problems / "undefined reference" / link path search order


I'm trying to link a program but I fail. The following reflects my
linking conditions:
- /usr/lib contains some libraries, let's call them libx, liby and libz.
- $(prefix)/somedir contains the same libraries (libx, liby, libz), but
those are newer, so they have more functions exposed.
- my Makefile.am contains the following linker flags:
"-Wl,--export-dynamic -pthread -L$(prefix)/somedir -lx -ly -lz".

Now, the linker obviously tries to link against libx, liby and libz in /
usr/lib instead of those in new prefix. Is there any way to override
this behavior? I already tried to set the environment variable
LD_LIBRARY_PATH to "$(prefix)/somedir", but it didn't work either.
I couldn't find any useful information in man gcc.

regs,
 Chris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]