Re: Can not link to shared libraries with LD_LIBRARY_PATH.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



   Hi, Ian.

   That's the message received:

helcio@jaguar: gcc -Wall test2.c
test2.c: Na função ‘main’:
/tmp/ccab0AHD.o: In function `main':

test2.c:(.text+0xa): undefined reference to `dlq_createQue'
collect2: ld returned 1 exit status

   As root, I've type 'ldconfig'. Nothing changed at all.

   Best regards.
 
---------------------------------------------
HELCIO WAGNER DA SILVA


----- Mensagem original -----
De: Ian Lance Taylor <iant@xxxxxxxxxx>
Para: Helcio Wagner <hwsilva@xxxxxxxxxxxx>
Cc: "gcc-help@xxxxxxxxxxx" <gcc-help@xxxxxxxxxxx>
Enviadas: Sexta-feira, 22 de Junho de 2012 2:49
Assunto: Re: Can not link to shared libraries with LD_LIBRARY_PATH.

Helcio Wagner <hwsilva@xxxxxxxxxxxx> writes:

>    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

It is not normally necessary to add these directories to
LD_LIBRARY_PATH.  See "man ldconfig".


>    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.

A problem at link time is most likely not due to LD_LIBRARY_PATH.

When reporting an error message, please cut and paste the exact,
complete, error output.  Otherwise we don't know what happened.

Ian




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux