Part Number: AM3352
Tool/software: TI-RTOS
Hi
Due to some requirements, we need C++ for some development.
The CCS version I used was CCS9.0.1.00004.
When I called the mutex class for compilation,
error was indicated: 'mutex' is not a member of 'std'.
I added -std=c++11 to the compilation option of the project, enabling it to support c++11.
what else I need to do to compile the options.
The code I verified was very simple,
my code is :
#include <iostream>
#include <cstring>
#include <mutex>
//#include <ti/radar/app/cirque.h>
using namespace std;
int app_c_pluse() {
std::mutex mtx; //用于加锁
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
and the compile console is :
-I"C:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF"111111.d" -MT"111111.o" -std=c++11 -fno-threadsafe-statics @"configPkg/compiler.opt" -o"111111.o" "C:/Users/24534/Desktop/111111.cpp"
subdir_rules.mk:9: recipe for target '111111.o' failed
C:/Users/24534/Desktop/111111.cpp: In function 'int app_c_pluse()':
C:/Users/24534/Desktop/111111.cpp:16:10: error: 'mutex' is not a member of 'std'
std::mutex mtx; //用于加锁
^~~~~
gmake: *** [111111.o] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
