[Top][All Lists]

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

RE: [avr-gcc-list] Building AVARICE on Cygwin

From: Ralph Mason
Subject: RE: [avr-gcc-list] Building AVARICE on Cygwin
Date: Tue, 22 Jul 2003 09:29:02 +1200

> As "Ralph Mason" <address@hidden> wrote:
> >$ gcc -lbfd test.c
> >/cygdrive/p/TEMP/ccmHuQtQ.o(.text+0x1f):test.c: undefined reference to
> >`_bfd_init'
> >collect2: ld returned 1 exit status
> >
> >I must be missing something simple.
> Yes, so simple that it really took me another view and yet another
> one to see it. ;-)
> Order is important when linking libraries: each invocation of a -lfoo
> option searches libfoo.a for all symbols that are currently
> unresolved, plus for any additional unresolved references that result
> out of linking of a module from that library.  So in your example,
> since the unresolved reference to _bfd_init is caused later on (by the
> temporary object file the compiler substitutes for test.c), it'll
> never get resolved.
> There are also cases where a library needs to be specified more than
> once.  For example, by default, gcc adds
> -lc -lgcc -lc
> at the end.  First, libc.a is searched.  This might cause any
> additional modules from libgcc.a to become required.  Finally, one of
> these modules might again require further modules from libc.a...

Hi Joerg,

Thanks for the reply.

I'm not really sure what to make of this. It doesn't make much sense (except
perhaps if you have a module(A) dependant on module(B) which depends on
Module(c) that has functions of the same names as in module A)

I don't really understand why the complier generated an object file stops it
from linking (what else would the linker work with?) Does not the -l get
passed to the linker?

How actually could I make this link? Then perhaps I can figure out how to
apply that to avarice and make that build.

Thanks for all the help
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003

reply via email to

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