bug-ncurses
[Top][All Lists]
Advanced

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

Re: trouble linking cdk


From: Thomas Dickey
Subject: Re: trouble linking cdk
Date: Fri, 20 Jul 2001 05:42:51 -0400
User-agent: Mutt/1.2.5i

On Thu, Jul 19, 2001 at 04:45:07PM -0700, Peter Jay Salzman wrote:
> dear all,
> 
> this is driving me nuts.  i installed (make, make install) the cdk.  the
> example programs compiled and linked fine.  i'm having trouble linking my
> own programs that use cdk.
> 
>   gcc -o ohs `gtk-config --libs` -lcdk -lncurses -L/usr/local/lib callback.o

depends on the system - on some, you must put the -L/usr/local/lib
before the -lcdk (likewise, -lcdk before -lncurses).  This is true of
most linkers if the library is static (shared libraries are treated
differently - the whole table of contents is usually loaded on the first
time the file is opened).

>   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'
>   (snip)
> 
> 
> the compiler /should/ complain if it doesn't find the libcdk.a, so i assume
> it's finding this file.

not all linkers do (I don't recall which offhand).
 
> however, i assume that all the *CDK* functions are in libcdk.a.  can some
> kind soul guess why i'm getting all these undefined references?
> 
> i realize this is a gcc question, not ncurses.  but i'm really stumped!  if i
> take NCURSESmain.c, give it a main() and compile it by itself, it works:
> 
> address@hidden gcc -c blah.c -I/usr/local/include/cdk
> address@hidden gcc blah.o -lncurses -lcdk
> 
> but it seems to choke when i link it with the other functions.
> 
> help?
> 
> thanks!
> pete
> 
> -- 
> "The following addresses had permanent fatal errors..."      address@hidden
>                                -- Mailer Daemon              www.dirac.org/p
> 
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-ncurses

-- 
Thomas E. Dickey <address@hidden>
http://dickey.his.com
ftp://dickey.his.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]