cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX for SW4STM32 : where is c++ compiler ?

JulienD
Senior
Posted on June 07, 2015 at 18:37

Hi,

I've generated a project with cubeMx for System workbench.

Now, I add some c++ classes which does not compile because they are

compiled by eclipse with gcc and not g++.

Can anyone tell me how to fix this ? I can neither find G++ options in project settings.

Thanks

Julien

#c++ #sw4stm32 #cpp
4 REPLIES 4
qwer.asdf
Senior
Posted on June 08, 2015 at 11:01

You may be more lucky asking this question in the OpenSTM32 (System Workbench)

http://www.openstm32.org/forum7

.
paulthomas9
Associate II
Posted on June 09, 2015 at 16:10

Can't you just set the compiler to g++ (see attached)?

thanks,

Paul

________________

Attachments :

g__.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzQU&d=%2Fa%2F0X0000000bLl%2FNPQ3vVRZmgOL8GDgp7nBOxwj1YKgvYUWEcsel.Dpebs&asPdf=false
daviddavid9
Associate II
Posted on July 18, 2015 at 04:22

I would also like to do this. Have found 2 ways to convert SW4STM32 to C++. After conversion linker brought many errors(undefined reference to `_exit', '_close' and others). Added a syscalls.c file which fixed it. But, now when I try to program the STM32L151RC I get following errors. Can anyone help?

** Programming Finished **

** Verify Started **

target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20008000

Error: checksum mismatch - attempting binary compare

diff 0 address 0x00008000. Was 0x82 instead of 0xf8

diff 1 address 0x00008001. Was 0x62 instead of 0xb5

diff 2 address 0x00008002. Was 0x98 instead of 0x00

..... Many more diff x lines .....

===== Converting Eclipse (SW4STM32 - System Workbench for STM32) to C++ =====

Method 1:

Simply add following line to .project file:

<nature>org.eclipse.cdt.core.ccnature</nature>

Method 2:

Select <File><New><Convert to C++ project> in menu bar

daviddavid9
Associate II
Posted on July 20, 2015 at 03:43

The problem was that after converting to C++ file, the linker file is removed from project properties. Have to go to settings and give in the linker file again.