This repo is about building OpenIGTLink used by Matlab in Windows.
- Windows 10 Pro for Workstations 21H1
- Matlab R2021b
- Visual Studio Professional 2019
- CMake 3.22.0-rc1
- For OpenH264, you also need MSYS2 x86_64-20210725 and NASM 2.15.05 x64
- Run CMake, Where is the source code:
path\to\OpenIGTLink
, Where to build the binaries:path\to\OpenIGTLink-build
. Click "Configure" and select your compiler (usually just click "OK") - Click "Configure", Message: "Build directory does not exit, should I create it?" - click "OK".
- Select your compiler: First Selector: Visual Studio 16 2019 - click "Finsh" (Maybe you should try several times in China ^_^) (How to set Proxy in cmake: Click
Environment Editor
and add variables:HTTP_PROXY
with valuehttp://127.0.0.1:xxxx
,HTTPS_PROXY
with valuehttp://127.0.0.1:xxxx
) - Select like this (If you do not need
VideoStream
andOpenH264
, you can deselect them and skip Step 2) - Click "Generate"
- Open
path\to\OpenIGTLink\OpenIGTLink.sln
withVisual Studio Professional 2019
and build for the first time. The building process will fail. Ignoring errors because this building is for downloading deps. - Go to
path\to\OpenIGTLink-build\Deps\openh264
- Copy
path\to\Tools\build_openh264.bat
topath\to\OpenIGTLink-build\Deps\openh264
. You should change paths inbuild_openh264.bat
according to yourVisual Studio Professional 2019
,MSYS2
andNASM
installing path. - double-click
build_openh264.bat
inpath\to\OpenIGTLink-build\Deps\openh264
and waiting for building completely.
- Go back to
Visual Studio Professional 2019
and rebuildOpenIGTLink
, you should build a release version, that is very important!!!. Otherwise, Matlab will throw a memory error.
- Run CMake, Where is the source code:
path\to\MatlabIGTL
, Where to build the binaries:path\to\MatlabIGTL-build
. Click "Configure" and select your compiler (usually just click "OK") - Click "Configure", Message: "Build directory does not exit, should I create it?" - click "OK".
- Select your compiler: First Selector: Visual Studio 16 2019 - click "Finsh"
- In Matlab, using
mex -setup
to set mex C and C++ builder asMicrosoft Visual C++ 2019
- Click "Generate"
- Go to
Visual Studio Professional 2019
and buildMatlabIGTL
, you should build a release version, that is very important!!!. Otherwise, Matlab will throw a memory error.