How to compile C++ function that uses the Boost library on linux machine
2 次查看(过去 30 天)
显示 更早的评论
Now I have a C++ function that includes class files in the same directory, and those classes have functions that uses several functions from the Boost library.
I tried the command:
mex -l:libboost_system.a myMex.cpp
and it compiles, but when I execute the output function:
myMex()
It produces an error:
Invalid MEX-file '/home/path/myMex.mexa64':
/usr/local/MATLAB/R2022b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by
/home/path/myMex.mexa64)
I searched several places online but cannot figure out what to do.
Could any one please show me the standard way to do such a task and show me how I may solve this issue?
Any help is greatly appreciated.
1 个评论
Rishav
2023-3-7
The error message you're seeing suggests that the version of libstdc++ being used by MATLAB doesn't have the required GLIBCXX version. This often happens when you build your MEX file on a newer version of Linux than the one used by MATLAB.
One solution is to build your MEX file on an older version of Linux that is compatible with the version of MATLAB you're using. Is this possible for you?
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!