c++makefilebuilding

Having problem building project in eclipse Embded system


I am building driver for atmega32, and when I try to build the project I got the error in the console. I am using the latest version of eclipse.

[console output]

04:43:37 **** Incremental Build of configuration Debug for project 
Project00 (Dio_Driver) ****
make all 
Building file: ../DIO.c
Invoking: AVR Compiler
avr-gcc -Wall -g2 -gstabs -O0 -fpack-struct -fshort-enums -ffunction- 
sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields 
-mmcu=atmega32 -DF_CPU=1000000UL -MMD -MP -MF"DIO.d" -MT"DIO.o" -c -o 
"DIO.o" "../DIO.c"
Finished building: ../DIO.c

Building file: ../main.c
Invoking: AVR Compiler
avr-gcc -Wall -g2 -gstabs -O0 -fpack-struct -fshort-enums -ffunction- 
sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields 
-mmcu=atmega32 -DF_CPU=1000000UL -MMD -MP -MF"main.d" -MT"main.o" -c -o 
"main.o" "../main.c"
Finished building: ../main.c

Building target: Project00 (Dio_Driver).elf
Invoking: AVR C Linker
avr-gcc -Wl,-Map,Project00 (Dio_Driver).map -mmcu=atmega32 -o "Project00 
(Dio_Driver).elf"  ./DIO.o ./main.o   
/usr/bin/sh: -c: line 1: syntax error near unexpected token `(D'
/usr/bin/sh: -c: line 1: `avr-gcc -Wl,-Map,Project00 (Dio_Driver).map - 
mmcu=atmega32 -o "Project00 (Dio_Driver).elf"  ./DIO.o ./main.o   '
make: *** [Project00 (Dio_Driver).elf] Error 258
"make all" terminated with exit code 2. Build might be incomplete.

04:43:38 Build Failed. 1 errors, 0 warnings. (took 592ms)

Solution

  • It seems like a CDT bug, if you didn't do a custom configuration. The error syntax error near unexpected token ... means the shell(/usr/bin/sh) can't parse the command line.

    As a remedy, change your project name to one without any spaces or parentheses, somewhat friendly to your system.