"F E" wrote in message <nkgngf$53c$
1...@newscl01ah.mathworks.com>...
I figured it out, so for the sake of completion (and to help anybody who's unlucky enough to run into this problem later on) I'll enumerate what I had done:
1) The MinGW64 C++ compiler that I was using didn't know where to look for the C++ libraries (though from what I've dug up, it is possible to modify the mex.bat file in Windows to path it properly -- in any case, read on). Follow the guide provided here:
https://www.mathworks.com/matlabcentral/answers/96611-how-do-i-install-microsoft-visual-c-2010-and-microsoft-windows-sdk-7-1
which details how to install the Microsoft Windows SDK7.1 compiler despite a know bug regarding order or installation. You may have to uninstall current version(s) of VC++ and associated software (redistributables, prereqs, etc.).
2) In my case, even after the installation mex didn't recognize the SDK compiler. I had to manually set it up using:
mex -setup:'C:\Program Files\MATLAB\R2016a\bin\win64\mexopts\winsdk-7.1_cpp.xml' C++
3) Attempting to compile now resulted in unresolved external symbols, rather than undefined functions. This is good (well, better). I then had to explicitly include WS2_32.lib at the end of my mex command. Since I was using the SDK compiler I gather it knew where to look for the library once included.
My command at the end therefore looked like this, where the .lib file was NOT in the local directory:
mex -I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" SingleAxisPacketSend.cpp Socket.cpp WS2_32.lib