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)
[vox-tech] linking question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] linking question

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

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



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:
Sunset Systems
Who graciously hosts our website & mailing lists!