l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2001 Dec 30 17:07

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] linking question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] linking question

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..."      p@dirac.org
>                                -- Mailer Daemon              www.dirac.org/p

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.