如何使用 'mex' 编译 Matlab/Simulink S-function 时指定 C++ 版本
为了在使用 mex 编译 Matlab 或 Simulink S-Function 时指定 C++ 版本,你需要指定 CXXFLAGS。
以下是 GCC 的示例。记住始终添加 -fPIC 到标志中,因为 Matlab 加载编译的库需要它。
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