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

sorry for the repost, everyone, but i just noticed the subject of my reply 
was different.  i'd like for this email to be threaded correctly in mutt and
especially the vox-tech archives in case anyone finds this thread useful in
the future.

sorry for the waste of bandwidth -- it's for a good cause.   :)


----- Forwarded message from p -----

Date: Fri, 20 Jul 2001 06:49:56 -0700
To: vox-tech@lists.lugod.org
Subject: 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

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!