Mar 19, 2016

Mex compilation issue


Compiling a new mex file I have received
cc1plus: error: unrecognized command line option ‘-std=c++11’ 
Tried to change the mexopts.sh file inside the MATLAB/R2015b/bin following this suggestion, but with no avail. 

 
Then Installed newer version of gcc (mine was 4.6 now installed 4.9) and the problem is gone.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
 

No comments: