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] 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

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!


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

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:
O'Reilly and Associates
For numerous book donations.