无法编译MEX
Unable to compile MEX
我正在尝试从C++源代码编译一些MATLAB MEX文件。我试图编译的文件可以在这里找到;我在32位系统MATLAB 2012a上使用Windows XP,并安装了Microsoft Windows SDK v7.1作为我的编译器。
如果我尝试编译,MATLAB会输出以下错误:
>> mex -O -largeArrayDims osc_free_address.c
osc_free_address.c
osc_free_address.c(1) : error C2059: syntax error : '<'
osc_free_address.c(37) : error C2015: too many characters in constant
osc_free_address.c(38) : error C2059: syntax error : '<'
osc_free_address.c(39) : error C2015: too many characters in constant
osc_free_address.c(39) : error C2015: too many characters in constant
osc_free_address.c(39) : error C2015: too many characters in constant
osc_free_address.c(41) : error C2018: unknown character '0x40'
osc_free_address.c(43) : error C2015: too many characters in constant
osc_free_address.c(44) : error C2015: too many characters in constant
osc_free_address.c(44) : error C2015: too many characters in constant
osc_free_address.c(44) : error C2015: too many characters in constant
osc_free_address.c(44) : error C2015: too many characters in constant
osc_free_address.c(46) : error C2059: syntax error : '<'
osc_free_address.c(82) : fatal error C1021: invalid preprocessor command 'page'
C:PROGRA~1MATLABR2012ABINMEX.PL: Error: Compile of 'osc_free_address.c' failed.
Error using mex (line 206)
Unable to complete successfully.
我已经使用mex-setup来设置我的编译器MicrosoftWindowsSDKv7.1。有趣的是,尽管我在系统上安装了它们,但MATLAB没有看到MSVisualStudioC++2008或2010。我还尝试过使用Lcc-win32C2.4.1编译器进行编译(被MATLAB识别为),效果如上所示。
我知道这组特定的C++源文件可能需要一个名为liblo的东西来编译(我不确定这是编译时还是运行时的要求);据我所知,我已经正确安装了这些,但问题可能也存在。
如有任何帮助,我们将不胜感激。
尝试将.c
文件重命名为.cpp
并重新编译
>> mex -largeArrayDims -O osc_free_address.cpp
此外,为什么不尝试该包附带的build m文件呢(如本问题所述)?
你下载并编译了liblo吗?您可能需要在mex
命令中为其添加include路径和库路径?
>> mex -largeArrayDims -O -I<liblo include path> -L<liblo lib path> -llo osc_free_address.cpp
相关文章:
- 使用 MEX 编译C++文件
- 使用 mex 编译库时出错 - __int 64 未命名类型
- complex_Bessel_function库的编译——与Fortran代码的链接——mex文件
- 使用 mkoctfile 与 Octave 和 Visual Studio 2010 编译器编译 .mex 或 .oct
- MEX 编译给出"there are no arguments to ... that depend on a template parameter"错误
- mex 编译错误: 无法识别的开关: -cxx
- 使用 mex 在 Matlab 中编译C++失败
- C++ MATLAB 中的 MEX 编译
- 在mex函数中使用OpenCV:编译后出错
- Matlab Mex代码未编译
- MATLAB + Mex + OpenCV:正确链接和编译,但在运行时找不到库
- MATLAB中的Myo臂章手势(无法编译.m或.mex文件)
- MATLAB MEX c++文件编译错误,找不到c++命令
- 使用Matlab R2011a在Ubuntu 11.04上编译Matlab mex文件时出错
- 试图用MATLAB的mex编译多个c++文件时出错
- 如何避免重复初始化.mex (matlab编译代码)
- 如何将 MATLAB 的 mex 设置定向到Microsoft Windows SDK 进行C++编译?(设置位置时出错)
- 在Matlab 2013a中编译并运行mex
- 在Visual Studio 2010中为从C文件编译的mex文件添加OpenMP支持
- 如何通过Matlab-Mex编译工具使用C++编译器