我正在尝试创建一个 C 共享库。
我是 Matlab 的新手,所以我按照以下步骤操作:
http://www.mathworks.com/support/solutions/en/data/1-UR7P0/index.html?solution=1-UR7P0
我已经创建了文章中所写的 Matlab 文件,并在文章的指导下完成了所有步骤。当我构建我的解决方案时,我收到此错误..
错误 LNK1104:无法打开文件“foolib.lib”
注意:我的 MATLAB 版本是 7.11.0.584(r2010b)
最佳答案
您应该将 foolib.lib 添加到 Visual Studio 中的链接器依赖项。 右键单击项目 -> 配置属性 -> 链接器 -> 输入 -> 附加依赖项。 在此处添加 foolib.lib 的完整路径,例如“C:\MyProject\MyLib\foolib.lib”
这在您的链接中被描述为第 6 步:
6 - After specifying the library directories, select the Input category and type the following libraries in the Additional Dependencies field: mclmcrrt.lib foolib.lib"
关于c++ - 使用 MATLAB 创建 C 共享库以在 VS2010 中使用时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9787450/