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)?
5 次查看(过去 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!