Re: gcc - Automatic library searching

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

 



"Sampei02" <sampei02@xxxxxxxxxx> writes:

> 'yp_get_default_domain' function is included in both "usr/lib/libnsl.a"
> static library and "/lib/libnsl.so.1" shared library; I verified the
> 'yp_get_default_domain' symbol presence with nm command in both libraries.
> I modified my loader configuration (/etc/ld.so.conf) adding '/lib' and
> '/usr/lib' searching paths so linker should have to look at my library
> ('libnsl.so.1' or 'libnsl.a') also in these folders, but nothing !
> I tried to run gcc directly inside both '/lib' and '/usr/lib' but nothing !

/etc/ld.so.conf only affects the runtime linker (ld.so).  It does not
affect the program linker (ld).  The program linker is the one
reporting this problem.

> 2- If I compile with 'gcc contest -g -O2 -lnsl conftest.c' I have no errors
> and gcc works fine.
> 
> /usr/lib/libnsl.a
> /lib/libnsl.so.1
> 
> I need to not specify '-lnsl' option to permit library automatic searching
> but I don't know to permit it.
> What do you think ?

You have to specify -lnsl.  There is no realistic alternative.

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