How to use modern features (notably std::unique_ptr) in the C++ code of my S-functions while using the linaro v4.8 toolchain in embedded coder?
Background
I am using simulink with S-functions containing custom C++ code. My simulink model runs on an ARM board running Linux, using embedded coder. My C++ code uses unique pointers (std::unique_ptr). The toolchain I use is Linaro v4.8.
The error
I get the following error when building the Linux executable using the simulink ‘build’ button:
C:/my_path/cpp/src/my_class.h:13:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
My idea
I suspect that the C++ version being compiled to is < c++11, and I would like to force the g++ compiler to compile the code using c++11. I can’t change compiler flags in the simulink menu, it is grayed out.
I found the linaro toolchain xml file and changed compiler flags there, but when I look at the compiler command generated in simulink I do not see the -std=c++11 compiler flag anywhere.
The question
How can I use modern features (notably std::unique_ptr) in the C++ code of my S-functions while using the linaro v4.8 toolchain in simulink embedded coder?Background
I am using simulink with S-functions containing custom C++ code. My simulink model runs on an ARM board running Linux, using embedded coder. My C++ code uses unique pointers (std::unique_ptr). The toolchain I use is Linaro v4.8.
The error
I get the following error when building the Linux executable using the simulink ‘build’ button:
C:/my_path/cpp/src/my_class.h:13:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
My idea
I suspect that the C++ version being compiled to is < c++11, and I would like to force the g++ compiler to compile the code using c++11. I can’t change compiler flags in the simulink menu, it is grayed out.
I found the linaro toolchain xml file and changed compiler flags there, but when I look at the compiler command generated in simulink I do not see the -std=c++11 compiler flag anywhere.
The question
How can I use modern features (notably std::unique_ptr) in the C++ code of my S-functions while using the linaro v4.8 toolchain in simulink embedded coder? Background
I am using simulink with S-functions containing custom C++ code. My simulink model runs on an ARM board running Linux, using embedded coder. My C++ code uses unique pointers (std::unique_ptr). The toolchain I use is Linaro v4.8.
The error
I get the following error when building the Linux executable using the simulink ‘build’ button:
C:/my_path/cpp/src/my_class.h:13:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
My idea
I suspect that the C++ version being compiled to is < c++11, and I would like to force the g++ compiler to compile the code using c++11. I can’t change compiler flags in the simulink menu, it is grayed out.
I found the linaro toolchain xml file and changed compiler flags there, but when I look at the compiler command generated in simulink I do not see the -std=c++11 compiler flag anywhere.
The question
How can I use modern features (notably std::unique_ptr) in the C++ code of my S-functions while using the linaro v4.8 toolchain in simulink embedded coder? embedded coder, s-function, simulink, linux MATLAB Answers — New Questions