Why do I receive the error "undefined symbol: __gxx_personality_v0" when I try to run a C++ MEX-file under MATLAB 6.1 (R12.1)?
조회 수: 6 (최근 30일)
이전 댓글 표시
Why do I receive the following error when I try to run a C++ MEX-file under MATLAB 6.1 (R12.1)?
Unable to load mex file:
/home/chenhon2/work/wk/mfiles/SingleFit.mexglx.
/home/chenhon2/work/wk/mfiles/SingleFit.mexglx: undefined symbol:
__gxx_personality_v0
??? Invalid MEX-file
채택된 답변
MathWorks Support Team
2009년 6월 27일
Some versions of LINUX need to link against certain C++ libraries to resolve undefined symbols when compiling C++ code.
The easiest way to do this is to use g++ to link the MEX-file. In MATLAB 6.5 (R13), this is automatically done by the mex script when it detects a C++ source file.
In earlier versions of MATLAB, you needed to specify a different option file to use when compiling C++ files. The name of the C++ options file to use is cxxopts.sh. For example, to compile your MEX-file from within MATLAB 6.1 (R12.1) you would use the following code:
eval(['mex -v -f ' matlabroot '/bin/cxxopts.sh your_mex_file.C'])
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call C++ from MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!