Mex не может найти g ++ - PullRequest
0 голосов
/ 10 октября 2019

Я совершенно новичок в MatLab, я пытаюсь скомпилировать файл .cpp, используя mex, через Matlab на redhat. Follwing - это вывод моей команды

mex myfile.cpp -v

No MEX options file identified; looking for an implicit selection.
... Looking for compiler 'g++' ...
... Executing command 'which g++' ...Yes ('/bin/g++').
... Executing command 'g++ -print-file-name=libstdc++.so' ...Yes ('/usr/lib/gcc/x86_64-redhat-linux/4.8.5/libstdc++.so').
... Executing command 'g++ -dumpversion' ...Yes ('4.8.5').
... Executing command 'which g++' ...Yes ('/bin/g++').
... Looking for folder '' ...No.

Did not find installed compiler 'g++'.
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.

Как мне скомпилировать этот файл?

wheris g ++ вывод

g++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz

MatLab версия 2018R

1 Ответ

1 голос
/ 10 октября 2019

Ваша версия gcc-4.8.5 слишком старая. Ссылка из сообщения об ошибке http://mathworks.com/support/requirements/supported-compilers.html содержит список поддержки gcc-6.3.X в linux. Пожалуйста, обновите ваш компилятор до gcc-6.3 или выше.

...