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 visualizaciones (últimos 30 días)
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

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
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'])

Más respuestas (0)

Categorías

Más información sobre Call C++ from MATLAB en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by