problems occur when compile

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Allen

problems occur when compile

Post by Allen » Thu Jan 08, 2009 8:26 pm

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.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Wed Jan 21, 2009 7:43 pm

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.

Post Reply