By default, Ubuntu 16.04 uses gcc and g++ 5.4. This is fine for Caffe installation, and in fact there is an official guide for that. However, even the latest Matlab release 2016b only supports gcc and g++ 4.9 for mex. This becomes an issue when compiling matcaffe. Apparently this problem is met by other people as well.
- Install gcc and g++ 4.9
ShortName="g++-4.9". Same goes for gcc in
Open Matlab and run
- Compile matcaffe by
libstdc++.so.6in the Matlab directory
- Relink OpenCV related libraries in the Matlab directory