Page 1 of 1

problems occur when compile

Posted: Thu Jan 08, 2009 8:26 pm
by Allen
Hello,

I had modify some codes in usbdrv.c, but when I compile the project, errors occur as follow:

avr-gcc -mmcu=atmega64 -mmcu=atmega64 -Wall -gdwarf-2 -DF_CPU=18432000UL -Os -fsigned-char -MD -MP -MT usbdrvasm.o -MF dep/usbdrvasm.o.d -x assembler-with-cpp -Wa,-gdwarf2 -c ../usbdrvasm.S
d:/program files/atmel/winavr/bin/../avr/include/stdint.h: Assembler messages:
d:/program files/atmel/winavr/bin/../avr/include/stdint.h:116: Error: unknown opcode `typedef'
d:/program files/atmel/winavr/bin/../avr/include/stdint.h:117: Error: unknown opcode `typedef'
...

Problems may be origin from the *.S file. It seems that it has include header files such as <avr/io.h>,, however the compiler fails to recognize the C key word.

My C code in usbdrv.c is OK, for it can be successfully compiled independently. And all the assembly files have not been modified. It's strange. Could you be possible to figure out where the fault might be? I am anxiously waiting for help.

Thank you.

Posted: Wed Jan 21, 2009 7:43 pm
by christian
Make sure that C code in any of the headers (and includes of headers with C code) are in an #ifndef __ASSEMBLER__. The assembler module includes some of the header files, but the assembler can't understand C syntax, of course.