This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Can not link to shared libraries with LD_LIBRARY_PATH.
- From: Helcio Wagner <hwsilva at yahoo dot com dot br>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 21 Jun 2012 22:05:24 -0700 (PDT)
- Subject: Can not link to shared libraries with LD_LIBRARY_PATH.
- Reply-to: Helcio Wagner <hwsilva at yahoo dot com dot br>
?Hi, gentlemen.
? ?I am using gcc?4.6.3 on Ubuntu 12.04.?
? ?First of all, I have no LD_LIBRARY_PATH environment variable set. Should I have it?
? ?Well, I've edited '.bashrc' file to define LD_LIBRARY_PATH and pointed it to '/usr/lib' and '/usr/local/lib' directories:
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
? ?My executable (named 'test') needs to be linked to two shared libraries to be generated: 'libncx.so.2.2' and 'libagt.so.2.2'. Both are located on '/usr/lib' directory. However, when I type 'gcc -Wall test2.c', there is a message relating undefined references. The executable was not generated.
? ?Indeed, I must provide the full path to those libraries, i.e., 'gcc -Wall teste2.c?/usr/lib/libncx.so.2.2 /usr/lib/libagt.so.2.2' in order to create the executable. I don't understand that, because they are located on default library search path.
? ?Does somebody help me to clarify that point? Thanks in advance. ??
---------------------------------------------
HELCIO WAGNER DA SILVA?