In Visual Studio a few more things are needed.
- Change Solution Platforms from "x86" to "x64".
- Add C/C++ include directories
From Project Properties, go to "C/C++ General" -> "Additional Include Directories" and add $MPS\client\c\include
where $MPS is installation folder of MATLAB Production Server,
for example, C:\Program Files\MATLAB\MATLAB Production Server\R2018b
- Add Linker library directroies
From Project Properties, go to "Linker" -> "General" -> "Additional Library Directories"
and add $MPS\client\c\win64\lib
- Add mpsclient.lib to linker
From Project Properties, go to "Linker" -> "Input" -> "Adiitional Dependencies" and add mpsclient.lib
- Build the cpp and create an exe.
- Copy libcurl.dll, mpsclient.dll and libprotobuf.dll from $MPS\client\c\win64\lib to the same folder of your exe file, then run the exe.
Hope this help.