Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Re: STM32CubeMX for SW4STM32 : where is c++ compiler ?

same for me..
(error: unknown type name ‘class’)

latest eclipse, latest tools and latest libs, everything up to date.. i also renamed main.c to main.cpp. Somehow the .cpp files are not being compiled by the cpp compiler in my guess..

does someone knows any possible workaround? a thousand thanks in advance

-I”D:/BACKUP/BACKUP3/willianma/Documents/stm32projects/FreeRTOSLwIPt4dhcp2eclipseN01/Drivers/CMSIS/Device/ST/STM32F4xx/Include” -I”D:/BACKUP/BACKUP3/willianma/Documents/stm32projects/FreeRTOSLwIPt4dhcp2eclipseN01/Inc” -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF”Src/freertos.d” -MT”Src/freertos.o” -o “Src/freertos.o” “../Src/freertos.c”
In file included from ../Src/freertos.c:41:0:
D:/BACKUP/BACKUP3/willianma/Documents/stm32projects/FreeRTOSLwIPt4dhcp2eclipseN01/Inc/TestCppClass.h:10:1: error: unknown type name ‘class’
class TestCppClass {

D:/BACKUP/BACKUP3/willianma/Documents/stm32projects/FreeRTOSLwIPt4dhcp2eclipseN01/Inc/TestCppClass.h:10:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
class TestCppClass {

make: *** Src/freertos.o Error 1

tryed the simplest class as below:

/*
* TestCppClass.h
*
* Created on: Mar 31, 2016
* Author: willi
*/

  1. ifndef _TESTCPPCLASS_H_
  2. define _TESTCPPCLASS_H_


class TestCppClass {
public:

TestCppClass();//constructor
virtual ~TestCppClass();//destructor
void setLenght(int len);
int getLenght(void);

private:
int lenght;
};

  1. endif /*_TESTCPPCLASS_H_ */


/*
* TestCppClass.cpp
*
* Created on: Mar 31, 2016
* Author: willi
*/

  1. include “TestCppClass.h”


TestCppClass::TestCppClass() {
// TODO Auto-generated constructor stub
lenght=0;
}

TestCppClass::~TestCppClass() {
// TODO Auto-generated destructor stub
}

void TestCppClass::setLenght(int len){
lenght = len;
}
int TestCppClass::getLenght(){
return this->lenght;
}

France

Hi,

To compile C++ code you must create a C++ project; if you have a C project, you must convert it by right clicking on your project >> Convert to C++

Then be careful, files suffixed by .c are C files, not C++ files, in which you should probably not include C++ header files (like you do above in SRC/freertos.c)...

Hope this helps,

Bernard (Ac6)


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs