c++ - 墨西哥找不到 g++
问题描述
我对 MatLab 完全陌生,我正在尝试通过 Redhat 上的 Matlab 使用 mex 编译一个 .cpp 文件。以下是我的命令的输出
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.
我怎样才能编译这个文件?
哪里 g++输出
g++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz
MatLab 版本是 2018R
解决方案
你的版本gcc-4.8.5
太旧了。错误消息http://mathworks.com/support/requirements/supported-compilers.html中的链接列出了对 linux 上 gcc-6.3.X 的支持。请将您的编译器升级到 gcc-6.3 或更高版本。
推荐阅读
- javascript - 我想根据我的结果制作自定义对象数组
- android - Android 使用自定义数组适配器
- apache-kafka-connect - 快照新表 SQL Server Debezium 连接器
- android - Kotlin Flow:当我有新订阅者时,如何从订阅流中获取缓存数据?
- reactjs - 忽略或防止 ESLint 错误破坏 React webpack 项目中的构建
- spring-boot - Spring Data JDBC 测试容器数据源
- spring - 春天打开新的光池,尽管旧的池已经存在
- ggpubr - ggarrange 不绘制每个 ggplot 对象
- c# - 如何使用 .NET 获取所有未读的 Windows 通知消息
- python - 如何编写一个函数让输出是范围(x,y)中的所有素数