avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Compiler linking error


From: Nick Brent
Subject: Re: [avr-gcc-list] Compiler linking error
Date: Fri, 27 Feb 2004 15:33:42 -0800

Hmm. That seemed to do something. I ran avr-ar with the -s option. I think
took out the 'LDFLAGS += libtest2.a' line that I mentioned earlier, and it
compiled just fine with make. I then ran a 'make clean' and tried to compile
with the command:

    avr-gcc -mmcu=atmega128 -lmyrobot test2.c

and I got the same error message as before. btw, I made sure libmyrobot.a is
in the avr/lib/ directory. I've gotten to the point where it works now, but
what I'd like to do is just give someone a copy of the library, tell them to
stick it and the corresponding headers in certain directories, and then just
call them like they would any other header file. And I'm not quite to that
point. Any suggestions?

                                        -Chris

----- Original Message -----
From: "E. Weddington" <address@hidden>
To: "AVR-GCC List" <address@hidden>; "Nick Brent"
<address@hidden>
Sent: Friday, February 27, 2004 3:13 PM
Subject: Re: [avr-gcc-list] Compiler linking error


> On 27 Feb 2004 at 14:56, Nick Brent wrote:
>
> > > > fine. I'm assuming there is some command line argument that avr-gcc
> > needs that
> > > > the regular gcc compile doesn't, but what is it? Any and all help is
> > > > appreciated.
> > > >
> > >
> > > avr-gcc -mmcu=atmega128 test2.c -o test2.ex -ltest2
> > >
> > > Note:
> > > 1. -l flag (lowercase L). See GCC user manual.
> > > 2. Position of library, generally after the other objects. Again see
GCC
> > user
> > > manual.
> > >
> >
> > Thanks for the response. The -l flag only works if the library
'libtest2.a' is
> > in a specific location such as /lib or /avr/lib. Thats not a problem,
but
> > weather or not I put it there or call it from the current directory, I
still get
> > the linking error. There is some problem I'm having with telling avr-gcc
to look
> > inside the library. That's why it works just fine when I use the object
files
> > directly.
> >
>
> Did you run avr-ranlib over your library? or alternatively use the -s flag
with
> avr-ar? This creates an index in your library; it might be what you need.
See
> the GNU Binutils manual for more information.
>

_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list


reply via email to

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