Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » syntax error compiling with "(" in command line
syntax error compiling with "(" in command line [message #1750900] Sat, 31 December 2016 22:00 Go to next message
Christian Schmitz is currently offline Christian SchmitzFriend
Messages: 2
Registered: December 2016
Junior Member
Hello everybody:
i am completely new programming on STM and Eclipse, so is possible some install mistake or another problem.

I run eclipse under Linux opensuse LEAP 42.1 (64 bits)
Eclipse data: Version: Mars.2 Release (4.5.2) Build id: 20160218-0600

Following a ST tutorial with a STM32F0 Discovery board i do the following steps:
1)generate the project with STM32cubeMX
2)From eclipse, import the project
3)add use code most simple that i can:
int a=0;
...
while(1){ //original generated while
a++;
}
4)BUILD, Here start the problem, i get the following error:

17:26:49 **** Incremental Build of configuration Debug for project disc-test1 ****
make -j2 all 
Building file: ../Src/stm32f0xx_hal_msp.c
Building file: ../Src/main.c
Invoking: MCU GCC Compiler
/home/wolf/prgs/stm32/disc-test1/disc-test1/Debug
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -std=c99 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F072xB -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Inc" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/STM32F0xx_HAL_Driver/Inc" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/STM32F0xx_HAL_Driver/Inc/Legacy" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/CMSIS/Device/ST/STM32F0xx/Include" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/CMSIS/Include"  -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Src/main.d" -MT"Src/main.o" -o "Src/main.o" "../Src/main.c"
/bin/sh: -c: línea 0: syntax error  near unexpected element `('
Invoking: MCU GCC Compiler
/home/wolf/prgs/stm32/disc-test1/disc-test1/Debug
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -std=c99 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F072xB -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Inc" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/STM32F0xx_HAL_Driver/Inc" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/STM32F0xx_HAL_Driver/Inc/Legacy" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/CMSIS/Device/ST/STM32F0xx/Include" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/CMSIS/Include"  -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Src/stm32f0xx_hal_msp.d" -MT"Src/stm32f0xx_hal_msp.o" -o "Src/stm32f0xx_hal_msp.o" "../Src/stm32f0xx_hal_msp.c"
/bin/sh: -c: línea 0: `arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -std=c99 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F072xB -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Inc" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/STM32F0xx_HAL_Driver/Inc" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/STM32F0xx_HAL_Driver/Inc/Legacy" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/CMSIS/Device/ST/STM32F0xx/Include" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/CMSIS/Include"  -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Src/main.d" -MT"Src/main.o" -o "Src/main.o" "../Src/main.c"'
Src/subdir.mk:27: recipe for target 'Src/main.o' failed
make: *** [Src/main.o] Error 1
make: *** waiting other task end....
Src/subdir.mk:27: recipe for target 'Src/stm32f0xx_hal_msp.o' failed
/bin/sh: -c: línea 0: syntax error near unexpected element `('
/bin/sh: -c: línea 0: `arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -std=c99 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F072xB -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Inc" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/STM32F0xx_HAL_Driver/Inc" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/STM32F0xx_HAL_Driver/Inc/Legacy" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/CMSIS/Device/ST/STM32F0xx/Include" -I"/home/wolf/prgs/stm32/disc-test1/disc-test1/Drivers/CMSIS/Include"  -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Src/stm32f0xx_hal_msp.d" -MT"Src/stm32f0xx_hal_msp.o" -o "Src/stm32f0xx_hal_msp.o" "../Src/stm32f0xx_hal_msp.c"'
make: *** [Src/stm32f0xx_hal_msp.o] Error 1

17:26:49 Build Finished (took 162ms)



The problem is that eclipse call to the compiler using:
-D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__))

instead of:
-D__weak=__attribute__\(\(weak\)\) -D__packed=__attribute__\(\(__packed__\)\)


How i can solve this problem?

Best Regards, happy new year for all and thanks in advance.
Re: syntax error compiling with "(" in command line [message #1751600 is a reply to message #1750900] Wed, 11 January 2017 18:54 Go to previous message
Christian Schmitz is currently offline Christian SchmitzFriend
Messages: 2
Registered: December 2016
Junior Member
I solved:
I change the default options on the following:
project->properties->C/C++ GENERAL->Code analysis->path and symbols ->Symbols

And change:
__attribute__((__packed__))
for
"__attribute__((__packed__))"

and
__attribute__((weak))
for
"__attribute__((weak))"

Please note that i add the "

Previous Topic:Neon: Run/Debug toolbar disappears
Next Topic:Unwanted Highlight in Dark Theme
Goto Forum:
  


Current Time: Thu Jan 27 16:09:23 GMT 2022

Powered by FUDForum. Page generated in 0.02079 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top