Using MATLAB API in C++, matOpen crashing program silently
问题 my problem is similar to this one but it is rather old and I cannot comment or upvote due to my (beginners) reputation. I am trying to compile the matcreat.cpp file from Matlab 2017b like this (using g++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0): g++ -c -o matcreat.o -I"C:\Program Files\MATLAB\R2017b\extern\include" matcreat.cpp g++ -o matcreat.exe matcreat.o -L"C:\Program Files\MATLAB\R2017b\extern\lib\win64\mingw64" -llibmat -llibmex -llibmx -llibeng The program has a main