This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: directory with object files
Am Dienstag, 30. Oktober 2007 18:02:21 schrieb Tom St Denis:
> Ingo Krabbe wrote:
> > Am Dienstag, 30. Oktober 2007 16:29:20 schrieb Peter Skvarka:
> >> My application needs to be linked with static libraries placed in some
> >> other directories than directory with application sources.
> >> When I set in makefile full path for needed static libraries, all is ok
> >> and it can be build.
> >> But I have several static libraries placed in several different
> >> directories, and I dont want to copy them into application directory
> >> either to use full pathes in makefile.
> >> Does exist some makefile variable which defines directoy for linked
> >> object files - needed static libraries ?
> >
> > As far as I know if you have a static library archive named
> >
> > libLibrary.a
> >
> > In a path
> >
> > /my/lib/dir/
> >
> > You should get a go with
> >
> > gcc -L/my/lib/dir -lLibrary $(OBJECT_FILES) -o Result
> >
> > There is no way to collect object files this way, but there are methods
> > for Make to collect all object files in a given directory:
>
> Dependencies go to the right, if "myobject.o" depends on libLibrary.a
> you should use
>
> gcc -L/my/lib/dir myobject.o -lLibrary -o Result
I'm quite indifferent with this topic. I think gcc is too. But there where
some c compilers in the late 80's where order matters. So stick to this
cleaner version.
>
> Tom
--
Mit freundlichen GrÃÃen / kind regards
I n g o K r a b b e
System Administrator / system administrator
_________________________________________________________________________
Elements of Art GmbH http://www.eoa.de
An der Eickesmuehle 22 41238 D-Moenchengladbach / Germany
fon: +49 (2166) 91567-3418 Registergericht: Moenchengladbach HRB 5855
fax: +49 (2166) 91567-99 Geschaeftsfuehrer: Erik Winterberg,
Sebastian Leppert