Why does MATLAB 7.0 (R14) crash or generate errors when I call mexErrMsgTxt() in a MEX-file?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 27 Jun. 2009
Bearbeitet: MathWorks Support Team
am 19 Apr. 2023
I compile my code from the MATLAB command prompt using the following command:
mex ctest.c CFLAGS='$CFLAGS -fexceptions'
mexopts.sh also shows that the fexception flag is included. When I call ctest from the command prompt, MATLAB still closes down when calling mexErrMsgTxt().
Akzeptierte Antwort
MathWorks Support Team
am 18 Apr. 2023
Bearbeitet: MathWorks Support Team
am 19 Apr. 2023
Crashes when invoking mexErrMsgTxt or general runtime errors may be caused by an incompatibility between the version of GCC used to compile the MEX-file and the version used to compile MATLAB's libraries. Note that the only officially supported version of GCC is provided in Technical Note 1601:
If you are using a different version of GCC, you can work around this issue by removing the runtime libraries from the MATLAB directory and allowing the libraries from your GCC installation to be called. Here are the required steps:
1. Move the runtime libraries that MATLAB ships for GCC to another directory:
cd $MATLAB
cd sys/os/glnx86
mkdir old
mv libstdc++.* libg2c.* libgcc_s* old
2. Try to run MATLAB. You should be using the system libraries (which should match the system GCC you are using). If MATLAB won't start due to missing libraries, or if your GCC is not installed in /usr/bin, then add the directory of your GCC installation to $LD_LIBRARY_PATH.
If you are using a supported version of GCC, then the issue may be related to your version of GLIBC. For more details, see:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!