How to specify C++ version when compiling Matlab/Simulink S-function using 'mex'
In order to specify the C++ version when compiling a Matlab or Simulink S-Function using mex, you need to specify the CXXFLAGS.
Here’s an example for GCC. Remember to always add -fPIC to the flags, as this is required for Matlab to load the compiled library.
mex_cxxflags.sh
mex CXXFLAGS="-fPIC -std=gnu++17" -lzmq mysfunction.cppCheck out similar posts by category:
Matlab/Simulink, C/C++
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow