c++ - matlab R2013a 和 MS VC++ 2013 之间的链接错误

标签 c++ matlab visual-c++ lnk2019 mixed-programming

我正在用 VC++ 编写 BCI 游戏应用程序,需要实现通用空间模式过滤 (CSP) 来提取特征。由于涉及大量编码,我更喜欢使用现有的 CSP Matlab 函数。我按照 here 中给出的步骤进行操作.但是,我收到以下链接错误消息:

1>------ Build started: Project: Test4, Configuration: Debug Win32 ------
1>test.obj : error LNK2019: unresolved external symbol _mxGetScalar referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _mxDestroyArray referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _mxCreateDoubleScalar referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engEvalString referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engOpen referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engClose referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engGetVariable referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engPutVariable referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engOutputBuffer referenced in function _main
1>D:\Test4\Debug\Test4.exe : fatal error LNK1120: 9 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

谁能帮我解决这个问题?如有任何意见,我们将不胜感激。提前致谢。

最佳答案

正如我在 referred post 中所说的那样,您必须保持平台一致:

The platforms of MATLAB and VC++ compile platform must be the same, i.e. Win32/x86 VC++ compile platform can only use x86 MATLAB and x64 VC++ compile platform can only use x64 MATLAB.

您正在使用 MATLAB x64,因此您也必须在 x64 中构建您的 VC 项目。

关于c++ - matlab R2013a 和 MS VC++ 2013 之间的链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26156440/

相关文章:

c++ - 为什么 int 在 64 位编译器上通常是 32 位的?

arrays - 如果在多个数组中找到,则删除行

matlab - 我可以在 Matlab 中抑制函数的命令窗口输出吗?

c++ - 将 CComPtr<IShelltem2> 转换为 LPWSTR*?

c++ - 如何在 native C++ 单元测试 (Visual Studio) 中打开项目中的文件?

c++ - 错误 C2228 : left of '.push_back' must have class/struct/union

javascript - 从前端将客户端文件传递给 webassembly

c++ - 在 C++ 中处理多维数组长度

java - TCP Java 客户端向 C++ 服务器发送数据

matlab - 从 C 访问 MATLAB 的 unicode 字符串