You are not logged in.

#1 2012-07-21 04:21:12

bludra84
Member
Registered: 2007-10-25
Posts: 20

help: avr-gcc library path problem while compiling for attiny13a

I've been trying to compile a simple program for the avr attiny13a microcontroller, but have gotten stuck with what appears to be a library path issue.

When I try to compile the object file to an elf, I get the following error:

$ avr-gcc -g -DF_CPU=9600000 -Wall -L/usr/avr/lib -Os -mmcu=attiny13a -o tmp.elf tmp.o 
/usr/bin/avr-ld: cannot find crttn13a.o: No such file or directory
collect2: error: ld returned 1 exit status

The library search path appears to be correct:

$ locate crttn13a.o
/usr/avr/lib/avr25/crttn13a.o

$ avr-gcc -print-search-dirs
install: /usr/lib/gcc/avr/4.7.1/
programs: =/usr/lib/gcc/avr/4.7.1/:/usr/lib/gcc/avr/4.7.1/:/usr/lib/gcc/avr/:/usr/lib/gcc/avr/4.7.1/:/usr/lib/gcc/avr/:/usr/lib/gcc/avr/4.7.1/../../../../avr/bin/avr/4.7.1/:/usr/lib/gcc/avr/4.7.1/../../../../avr/bin/
libraries: =/usr/lib/gcc/avr/4.7.1/:/usr/lib/gcc/avr/4.7.1/../../../../avr/lib/avr/4.7.1/:/usr/lib/gcc/avr/4.7.1/../../../../avr/lib/

Can any of you see what I am missing here?

Last edited by bludra84 (2012-07-21 04:22:38)

Offline

#2 2012-07-24 13:23:18

drobole
Member
From: Norway
Registered: 2012-07-23
Posts: 125

Re: help: avr-gcc library path problem while compiling for attiny13a

Your gcc command says -L/usr/avr/lib but the library is in /usr/avr/lib/avr25

Offline

#3 2012-07-24 14:55:34

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,784

Re: help: avr-gcc library path problem while compiling for attiny13a

I am pretty sure the drobole has the answer.

The first thing that came to my mind is to be careful with the locate command.  It is a great tool, but all it tells you is that /usr/avr/lib/avr25/crttn13a.o existed the last time you ran updatedb.  No guarantees it is there now smile


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB