mex with MATLAB2013a Unrecognized switch: -o(mex 与 MATLAB2013a 无法识别的开关:-o)
问题描述
我正在尝试运行一个使用 mex 编译一些 c++ 代码的代码.我已经使用 Microsoft Visual C++ 2010 设置了 mex.但是当我执行该行
I am trying to run a code which compiles some c++ codes using mex. I have set up mex with Microsoft Visual C++ 2010. But when I execute the line
mex -O fconv.cc -o fconv
mex -O fconv.cc -o fconv
我收到错误
compile
Usage:
MEX [option1 ... optionN] sourcefile1 [... sourcefileN]
[objectfile1 ... objectfileN] [libraryfile1 ... libraryfileN]
Use the -help option for more information, or consult the MATLAB API Guide.
C:PROGRA~1MATLABR2011ABINMEX.PL: Error: Unrecognized switch: -o.
我用谷歌搜索了很多,但找不到任何有用的东西.如果有人能在这里帮助我,那就太好了.我对使用 mex 的了解非常有限.
I have googled a lot but couldn't find anything of use. It would be great if you someone could help me out here. I have very limited knowledge of using mex.
推荐答案
来自 mex 的 R2013a 文档(和 当前版本),没有-o选项,但是有-output:
From the R2013a docs for mex (and current version), there is no -o option, but there is -output:
-输出结果名称创建名为 resultname 的二进制 MEX 文件.自动附加适当的 MEX 文件扩展名.覆盖默认的 MEX 文件命名机制.
-output resultnameCreate binary MEX-file named resultname. Automatically appends the appropriate MEX-file extension. Overrides the default MEX-file naming mechanism.
顺便说一句,除非您使用 -g,否则默认情况下启用大 O 选项 (-O).
BTW, the big O option (-O) is on by default unless you use -g.
请记住,mex 不是编译器,而是编译器的前端.它的语法与您可能用于编译器的语法大不相同.
Keep in mind that mex is not a compiler, but a frontend to the compiler. It has very different syntax from what you might be used to for a compiler.
这篇关于mex 与 MATLAB2013a 无法识别的开关:-o的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:mex 与 MATLAB2013a 无法识别的开关:-o
基础教程推荐
- 我有静态或动态 boost 库吗? 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
