0
votes

I have gcc version 5.3.1 on fedora 23 and I want to run some mex files. Whe I compile the file I get the following warning:

Warning: You are using gcc version '5.3.1-6)'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.

and when I try to run it I get the following error :

Invalid MEX-file '/home/x/Downloads/MatlabEXR/MatlabEXR/exrread.mexa64': /usr/local/MATLAB/R2016a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/x/Downloads/MatlabEXR/MatlabEXR/exrread.mexa64)

I tried this : How to tell mex to link with the libstdc++.so.6 in /usr/lib instead of the one in the MATLAB directory?

but still I get the same error. Anything in mind what can be the problem?

2
The error is very clear. You are using a newer compiler than the one that MEX supports. You have to use gcc 4.7.x so that it's compatible with MEX. See this link from MathWorks for more details: mathworks.com/support/compilers/R2016a/index.html?sec=glnxa64rayryeng
how can I have both gcc-4.7 and gcc 5.3.1 and link matlab to the older version?user3178756

2 Answers

1
votes

I had a similar problem regarding libstdc++(I couldn't plot anything). This is the link to my question. matlab on linux can't plot anything(can't load libstdc++.so.6: version `CXXABI_1.3.8' not found)

How I solved the issue is also stated there.

Hope that helps

0
votes

You error is originated from the fact that your libstdc++ uses a new ABI by default (https://gcc.gnu.org/gcc-5/changes.html). You can't link your MEX files using gcc 5.xx version.