如何使用 Boost 库构建 MEX 函数
How to you build a MEX function with Boost Libraries?
我正在尝试使用Boost库来编写多线程MEX函数。我已经安装了Boost库并使用Visual Studios对其进行了测试。我编写了以下 MEX 函数,并尝试在 MATLAB 控制台中构建它:
#include "mex.h"
#include <boost/filesystem.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/thread/thread.hpp>
#include <boost/lockfree/spsc_queue.hpp>
#include <boost/atomic.hpp>
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
}
这是输出
>> mex simpleBoostExample.cpp -IC:FolderOtherFolderMATLABFilesboostboost_1_67_0
Building with 'Microsoft Visual C++ 2017'.
Error using mex
LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc141-mt-x64-1_67.lib'
现在我已经将 Boost 库文件添加到 MATLAB PATH 中,如下所示:
path(oldpath, 'C:FolderOtherFolderMATLABFilesboostboost_1_67_0')
setenv('PATH', [getenv('PATH') ';C:FolderOtherFolderMATLABFilesboostboost_1_67_0stagelib']);
所以我不确定我错过了什么。
使用 -L
和 -l
与(可选)libfolder 中的动态对象库 libname 链接。
-LC:\Folder\OtherFolder\MATLAB\Files\boost\boost_1_67_0 -llibboost_filesystem-vc141-mt-x64-1_67.lib
相关文章:
- 索引和访问 mex 函数中单元数组和矩阵的元素
- 创建 Matlab MEX 函数时,我是否将 mexFunction 放在 c++ 头文件或源文件中
- 从MEX函数中清除MATLAB命令窗口
- 如何将整数值作为 mex 函数的输入传递?
- 如何使用 Boost 库构建 MEX 函数
- 如何在多线程 MEX 函数中打印到控制台?
- 在 matlab 中编写一个非常基本的 mex 函数
- 在mex函数中返回双指针2D矩阵
- 如何从mex函数返回矩阵结构
- 无法解析 MEX 函数 Eclipse
- 如何在 Matlab 中分析一个 MEX 函数
- 为什么此 MEX 函数会产生意外结果
- 从Matlab调用的Mex函数和数值差分
- 在mex函数中使用OpenCV:编译后出错
- 如何在 MEX 函数运行时制作它 printf?
- 使用c++ mex函数从matlab中获取输入参数
- Matlab在多次调用mex函数后没有响应
- Mex函数比相同的c++代码更快
- C-Mex函数和共享内存的多个实例
- 如何访问传递给MEX函数的矩阵成员