In all of the following instructions, replace <mcrroot> with the location the MATLAB Compiler Runtime is installed on your machine.
From your Visual Studio 2017 C++ project:
1) Open the Project > Properties menu and make sure the platform is set to "x64"
2) Under C/C++ > General, add the following directories to "Additional Include Directories"
a. The directory that "factlib.h" is in
b. <mcrroot>\extern\include
3) Under Linker > General, add the following directories to "Additional Library Directories"
a. The directory that "factlib.lib" is in
b. <mcrroot>\extern\lib\win64\microsoft
4) Under Linker > Input, add the following libraries to the list in "Additional Dependencies"
a. factlib.lib
b. mclmcrrt.lib
5) Save the project and close Visual Studio. Add the following directories to the Windows System Path:
a. The directory that "factlib.dll" is in
b. <mcrroot>\runtime\win64
6) Open Visual Studio and ensure that the Solution Platform is set to "x64" from the dropdown.
7) Build and execute "vs_example.exe"
Best Answer