Trouble compiling Mex files, "standard C libraries not found."
Mostra commenti meno recenti
I'm running Ubuntu and Matlab R2011b, and am trying to get a kdtree implementation to run in Matlab. (see here: <http://www.mathworks.com/matlabcentral/fileexchange/21512). Upon extracting, I add the folder to my run path, navigate to it in Matlab, and manually run the mex command on each file -
mex kdtree_build.cpp mex kdtree_delete.cpp etc.
Attempting to run the resulting mex files, however, gives me the error -
Invalid MEX-file '/home/alex/workspace/Daubechies/MatlabToolboxes/kdtree/kdtree_build.mexglx': /usr/local/MATLAB/R2011b/bin/glnx86/../../sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.15' not found.
This seems odd, as if I navigate to that folder, the libstdc++.so.6 file is in fact there. Any thoughts on what is going wrong and how to fix it?
Risposte (3)
Kaustubha Govind
il 19 Mar 2012
0 voti
This might help.
Bryan
il 31 Mag 2012
0 voti
The problem is not with finding libstdc++.so.6, but rather with the symbol versions included in the MATLAB supplied libraries. One solution is to make sure you are using a compatible compiler version. Attempting to use a newer compiler will likely introduce dynamic links to newer symbol versions that would be fine using the gcc supplied libraries (ie at compile time), but fail using the MATLAB supplied libraries (ie at run time).
Ken Atwell
il 3 Giu 2012
I would be tempted to try removing the MathWorks-supplied libraries from the search path inside of MATLAB:
setenv('LD_LIBRARY_PATH','');
mex ...
Does that help? Even if you manage build, your MEX-File may crash because you'll be linking against a C++ library that is different than the one that MATLAB itself was linked against (side effect are unpredictable in this situation). If stability is a problem, see Bryan's answer.
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!