Mex error. Collect2 -lstdc++
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hey. I'm trying to compile a mex function, and I'm having a little trouble. Any help would be appreciated.
The command is
mex('-DDEFINEUNIX','-largeArrayDims','mtimesx.c','/usr/lib64/libblas.so.3.2.1')
and the error I'm getting is:
Warning: You are using gcc version "4.4.0". The version
currently supported with MEX is "4.3.4".
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/current_release/
mtimesx.c: In function ‘mexFunction’:
mtimesx.c:592: warning: assignment discards qualifiers from pointer target type
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
mex: link of ' "mtimesx.mexa64"' failed.exa64"' failed.
Any thoughts on what might be going wrong?
0 commentaires
Réponses (1)
Ken Atwell
le 3 Avr 2012
What Linux distro are you running? I'll ignore the warns and address the link error:
It looks like the g++ libraries are not installed on your system, and MATLAB needs to them to link. Yes, you are "only" using C and not C++, but the MATLAB libraries you link against require C++ libraries.
In short, you'll want to install the "gcc-g++" package, or something with a similar name, depending on the distribution you are using.
0 commentaires
Voir également
Catégories
En savoir plus sur Write C Functions Callable from MATLAB (MEX Files) 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!