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

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

[avr-gcc-list] can't compile simple test.c


From: Gregory Berardi
Subject: [avr-gcc-list] can't compile simple test.c
Date: 24 Aug 2003 13:52:49 -0500

I have posted a question to the list in last couple days and have been
happy with the support I have gotten but I still haven't been able to
get what I'm trying to compile to work. I am trying to compile a large
project that was originally developed in IAR (not by me ;0P ).  I
decided that I really needed to step back and try the problem I am
having in a very simple example.  I have included the source and the
makefile that I'm working with that generates the same error.  I took
the makefile from an example "Selfgenerating Makefile" that I found
here;

http://www.mip.sdu.dk/~madmax/Content/AVR-GCC/Makefile.php

I should mention that I am using linux.

I also should mention that I am new to avr-gcc and as such I might doing
something very stupid.

When I run make I get the following output;


address@hidden TEST]# make
avr-gcc -g -Os -mmcu=atmega103 -I/usr/local/avr/include/ -c -o
obj/test.o test.c
test.c:6: error: parse error before '(' token
test.c:15: error: parse error before '(' token
make: *** [test.o] Error 1


If I add -E to the CFLAGS, as suggested by Joerg Wunsch so that I may
see the preprocessor output, the code compiles and I get no errors but
the linker doesn't recognize the file format of the object file.

address@hidden TEST]# make
avr-gcc -E -g -Os -mmcu=atmega103 -I/usr/local/avr/include/ -c -o
obj/test.o test.c
mkdir -p obj
avr-gcc -lm -o test.elf obj/*.o
obj/test.o: file not recognized: File format not recognized
make: *** [all] Error 1


I have tried just using the command line;

address@hidden TEST]# avr-gcc -mmcu=atmega103 -I/usr/local/avr/include/ -c
-o obj/test.o test.c
test.c:6: error: parse error before '(' token
test.c:15: error: parse error before '(' token


The frustrating thing is that the code compiles fine with just straight
gcc;

gcc test.c -o test

What am I missing here?


TIA


-greg



Attachment: Makefile
Description: Text Data

Attachment: test.c
Description: Text Data


reply via email to

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