Using Boost Library in MEX Function

4 views (last 30 days)
NaiveMeasurement
NaiveMeasurement on 1 Jan 2019
Commented: Walter Roberson on 2 Jan 2019
I'm trying to use the Boost Libraries to write a multi-threaded MEX function.
Now I've already added the Boost Library files to the MATLAB PATH and the Linker Path like this:
path(oldpath, 'C:\Folder\OtherFolder\MATLAB\Files\boost\boost_1_67_0')
setenv('PATH', [getenv('PATH') ';C:\Folder\OtherFolder\MATLAB\Files\boost\boost_1_67_0\stage\lib']);
So I'm not sure what I'm missing.
  1 Comment
Walter Roberson
Walter Roberson on 2 Jan 2019
MATLAB path and PATH environment variable are both ignored when searching for libraries. You need the -L option to tell it where to look for the libraries.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 1 Jan 2019
mex simpleBoostExample.cpp -IC:\Folder\OtherFolder\MATLAB\Files\boost\boost_1_67_0 -LC:\Folder\OtherFolder\MATLAB\Files\boost\boost_1_67_0 -lboost -lboost_thread
I might not have exactly the right libraries for your purpose.

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!