How to compile C++ function that uses the Boost library on linux machine
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Rishav
le 7 Mar 2023
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?
Réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Compiler dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!