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
*/
- ifndef _TESTCPPCLASS_H_
- define _TESTCPPCLASS_H_
class TestCppClass {
public:
TestCppClass();//constructor
virtual ~TestCppClass();//destructor
void setLenght(int len);
int getLenght(void);
private:
int lenght;
};
- endif /*_TESTCPPCLASS_H_ */
/*
* TestCppClass.cpp
*
* Created on: Mar 31, 2016
* Author: willi
*/
- 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;
}