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
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 件)

カテゴリ

Help Center および File ExchangeCall C++ from MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by