필터 지우기
필터 지우기

Mex error. Collect2 -lstdc++

조회 수: 5 (최근 30일)
Jonathan Sullivan
Jonathan Sullivan 2012년 4월 2일
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?

답변 (1개)

Ken Atwell
Ken Atwell 2012년 4월 3일
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.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by