/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Unable to compile C++ project

Username:     
Password:     
             

Forum

# 1   2010-05-24 16:18:06 Unable to compile C++ project

Fr4nz
New member
Registered: 2010-05-24
Posts: 2

Unable to compile C++ project

Hello all,

after numerous attempts I'm still not able to compile a C++ project under Ride7 (I'm using Windows XP). I know that C++ isn't officialy supported by the IDE, but in this post:

http://www.stm32circle.com/forum/viewtopic.php?id=433

VincentC gave some indications in order to compile a C++ project under Ride (above all, using cclib and libstdc).
Unfortunately the linker gives me these error messages:

Code:

Running: LD 
 "C:\Programmi\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=cortex-m3 -
mthumb -Wl,-T -Xlinker "out\FW FAS.elf.ld" -u _start -Wl,-static -Wl,--gc-sections
 -nostartfiles -Wl,-Map -Xlinker "lst\FW FAS.map" -Wl,--warn-once  -cclib -lstdc++ 
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/bin/ld.exe: out\FW FAS.elf section .text will not fit in region FLASH  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/bin/ld.exe: region FLASH overflowed by 2024 bytes  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-abort.o): In function `abort':  
 abort.c:(.text+0x8): undefined reference to `_exit'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_getpid_r':  
 signalr.c:(.text+0x2): undefined reference to `_getpid'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_kill_r':  
 signalr.c:(.text+0x1c): undefined reference to `_kill'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-closer.o): In function `_close_r':  
 closer.c:(.text+0x12): undefined reference to `_close'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-fstatr.o): In function `_fstat_r':  
 fstatr.c:(.text+0x14): undefined reference to `_fstat'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-isattyr.o): In function `_isatty_r':  
 isattyr.c:(.text+0x12): undefined reference to `_isatty'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-lseekr.o): In function `_lseek_r':  
 lseekr.c:(.text+0x16): undefined reference to `_lseek'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-readr.o): In function `_read_r':  
 readr.c:(.text+0x16): undefined reference to `_read'  
 C:\Programmi\Raisonance\Ride\Lib\ARM\STM32x_io_putchar_thumb.a(STM32F10X_IO_putchar.o): 
In function `__io_init':  
 STM32F10X_IO_putchar.c:(.text.__io_init+0xc): undefined reference to `RCC_APB2PeriphClockCmd'  
 STM32F10X_IO_putchar.c:(.text.__io_init+0x42): undefined reference to `GPIO_Init'  
 STM32F10X_IO_putchar.c:(.text.__io_init+0x8c): undefined reference to `USART_Init'  
 STM32F10X_IO_putchar.c:(.text.__io_init+0x96): undefined reference to `USART_Cmd'  
 C:\Programmi\Raisonance\Ride\Lib\ARM\STM32x_io_putchar_thumb.a(STM32F10X_IO_putchar.o):
 In function `__io_putchar':  
 STM32F10X_IO_putchar.c:(.text.__io_putchar+0x32): undefined reference to `USART_GetFlagStatus'  
 STM32F10X_IO_putchar.c:(.text.__io_putchar+0x44): undefined reference to `USART_SendData'  
 collect2: ld returned 1 exit status  
 arm-none-eabi-gcc.exe: unrecognized option '-cclib'

Note the numerous "undefined reference ...".
Anyone can help me?

Last edited by Fr4nz (2010-05-25 08:08:05)

Offline

 

# 2   2010-05-25 07:54:00 Unable to compile C++ project

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Unable to compile C++ project

The first thing we can see is the message "region FLASH overflowed by 2024 bytes " : so the first thing to do is to reduce the size of your code, or change the optimization configuration of your compiler, or modify your link script.

Offline

 

# 3   2010-05-25 07:56:44 Unable to compile C++ project

Fr4nz
New member
Registered: 2010-05-24
Posts: 2

Re: Unable to compile C++ project

yrt :

The first thing we can see is the message "region FLASH overflowed by 2024 bytes " : so the first thing to do is to reduce the size of your code, or change the optimization configuration of your compiler, or modify your link script.

This is caused by the option "Starter Kit limited", which was enabled. After disabling it (and after disabling the "UART0 putchar" option), I obtain this:


Code:

Building C:\Documents and Settings\francesco.lettich\Documenti\Progetti\Prosa\FirmwareFAS\FW FAS.rapp 
 Running: LD 
 "C:\Programmi\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=cortex-m3 -
mthumb -Wl,-T -Xlinker "out\FW FAS.elf.ld" -u _start -Wl,-static -Wl,--gc-sections -
nostartfiles -Wl,-Map -Xlinker "lst\FW FAS.map" -Wl,--warn-once  -Wl,-lstdc++ 
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-abort.o): In function `abort':  
 abort.c:(.text+0x8): undefined reference to `_exit'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_getpid_r':  
 signalr.c:(.text+0x2): undefined reference to `_getpid'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_kill_r':  
 signalr.c:(.text+0x1c): undefined reference to `_kill'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-writer.o): In function `_write_r':  
 writer.c:(.text+0x16): undefined reference to `_write'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-closer.o): In function `_close_r':  
 closer.c:(.text+0x12): undefined reference to `_close'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-fstatr.o): In function `_fstat_r':  
 fstatr.c:(.text+0x14): undefined reference to `_fstat'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-isattyr.o): In function `_isatty_r':  
 isattyr.c:(.text+0x12): undefined reference to `_isatty'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-lseekr.o): In function `_lseek_r':  
 lseekr.c:(.text+0x16): undefined reference to `_lseek'  
 c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-
none-eabi/lib/thumb2\libc.a(lib_a-readr.o): In function `_read_r':  
 readr.c:(.text+0x16): undefined reference to `_read'  
 collect2: ld returned 1 exit status  
  
Build failed

So, that wasn't the cause of my problems...any suggestion?

Last edited by Fr4nz (2010-05-25 08:06:15)

Offline

 

# 4   2010-07-13 07:50:01 Unable to compile C++ project

domen
Member
Registered: 2008-10-27
Posts: 10

Re: Unable to compile C++ project

Your libc wants some stubs, check ie.:

http://www.openhardware.net/Embedded_ARM/NewLib_Stubs/

Offline

 

# 5   2011-02-05 06:36:37 Unable to compile C++ project

kevinpeter
New member
Registered: 2011-02-05
Posts: 5

Re: Unable to compile C++ project

Error    1    error C2061: syntax error : identifier 'PTRANSACTION_NOTIFICATION'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ktmw32.h    192    1    FuckCPP
Error    2    error C2061: syntax error : identifier 'PTRANSACTION_NOTIFICATION'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ktmw32.h    202    1    FuckCPP
Error    3    error C2061: syntax error : identifier 'NOTIFICATION_MASK'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ktmw32.h    222    1    FuckCPP
Error    4    error C2146: syntax error : missing ';' before identifier 'RegCreateKeyExW'    c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h    202    1    FuckCPP
Error    5    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h    202    1    FuckCPP
Error    6    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h    211    1    FuckCPP
Warning    7    warning C4183: 'RegCreateKeyExW': missing return type; assumed to be a member function returning 'int'    c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h    211    1    FuckCPP
Error    8    error C2146: syntax error : missing ';' before identifier 'RegOpenKeyExW'    c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h    221    1    FuckCPP
Error    9    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h    221    1    FuckCPP
Error    10    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltransactionmanager.h    226    1    FuckCPP

Offline

 

# 6   2011-04-04 10:53:39 Unable to compile C++ project

harrylubanski
New member
Registered: 2011-04-04
Posts: 1

Re: Unable to compile C++ project

Error    1    error C2061: syntax error : identifier 'PTRANSACTION_NOTIFICATION'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ktmw32.h    192    1    FuckCPP
Error    2    error C2061: syntax error : identifier 'PTRANSACTION_NOTIFICATION'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ktmw32.h    202    1    FuckCPP

Offline

 

Board footer