LD_LIBRARY_PATH is searched /first/,
then the explicit -L directories.

LD_LIBRARY_PATH may not be exported and defined,
but ".:lib:${HOME}/lib" or something like that is always
prepended to whatever other system directories this
variable may have.

--nostartfiles ignores system startup files on linking
--nostdlib applies to the linking process for /not/ having
the system search the default paths -- you must specify
any system libraries explicitly.

Brian S.



Peter Jay Salzman wrote:

> hi all,
>
> i'm getting an error:
>
>   gcc -o ohs `gtk-config --libs` -lncurses -lcdk -L/usr/local/lib callback.o
>   main.o content.o pfunctions.o GTKmain.o NCURSESmain.o
>   NCURSESmain.o: In function `NCURSESmain':
>   NCURSESmain.o(.text+0x37): undefined reference to `initCDKScreen'
>   NCURSESmain.o(.text+0x44): undefined reference to `initCDKColor'
>   NCURSESmain.o(.text+0x118): undefined reference to `newCDKLabel'
>   NCURSESmain.o(.text+0x147): undefined reference to `newCDKMenu'
>   NCURSESmain.o(.text+0x164): undefined reference to `setCDKMenuPostProcess'
>   ...
>
> i verified that the *CDK* functions are stored in /usr/local/lib/libcdk.a.
>
> however, if the compiler couldn't find libcdk.a from the "-Lcdk" directive,
> it should've complained.
>
> here's the wierd part.  i renamed NCURSESmain.c (to blah.c) and gave it a
> main() function.  this worked:
>
>   p@satan% gcc -c blah.c -I/usr/local/include/cdk
>   p@satan% gcc blah.o -lncurses -lcdk
>   p@satan%
>
> links fine when it's a standalone file.  gives undef references when i use it
> with other files (i take this to mean that gcc automatically searches in
> /usr/local/lib for .a files).
>
> help?
>
> thanks!
> pete
>
> ps- cdk provides a set of widgets using the ncurses library.
>
> --
> "The following addresses had permanent fatal errors..."      [EMAIL PROTECTED]
>                                -- Mailer Daemon              www.dirac.org/p

Reply via email to