l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
September 2: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
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] Re: your mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] Re: your mail



dave, you made my day.

the object files go before the linking directives, so this doesn't work:

  gcc -o ohs `gtk-config --libs` -lcdk -lncurses callback.o (other .o files)

but this does:

  gcc -o ohs callback.o (other .o files) `gtk-config --libs` -lcdk -lncurses

note that gcc seems to already look in /usr/local/lib for static libraries,
so my -L directive was superfluous.

i don't see anything in the man pages that could've prevented me from
falling into this trap.  i guess the past few years i've been "getting it
right" without knowing that "object files come before linking directives for
gcc".

the wierd thing is that gcc found the static library (i checked -- gcc does
produce a fatal error if it can't find a lib).  it just didn't DO anything
with the library when the object files are listed at the end.

btw, cdk is nothing short of amazing.  whoever the author is, he did a
terrific job!

thanks, dave!

pete


begin: Dave Peticolas <dave@krondo.com> quote
> > 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':
> 
> Have you tried putting the .o files first? In other words:
> 
> gcc -o ohs callback.o main.o content.o pfunctions.o GTKmain.o 
> NCURSESmain.o -L/usr/local/lib `gtk-config --libs` -lncurses -lcdk
> 
> dave
> 
> 

-- 
"The following addresses had permanent fatal errors..."      p@dirac.org
                               -- Mailer Daemon              www.dirac.org/p


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
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:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.