I have the following problem: I have a 64 bit version of matlab 2011b. I need to call some functions from a DLL. This has been working some time ago with the prof version of visual studio 2010.
Now I want to get it running with the express version. I therefore installed the visual Studio C++ 2010 Express and the Win SDK 7.1. Now I give matlab the command mex -setup
and select the VC++ compiler. All right!
If I want to load the dll itself with loadlibrary
, I get tons of errors. Something like:
Building libFramework_thunk_pcwin64 failed. Compiler output is:
cl -I"C:\MATLAB\R2011b\extern\include" /W3 /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /nologo -I"U:\Framework\Framework\so" -I"U:\Framework\Framework\so" "libFramework_thunk_pcwin64.c" -LD -Fe"libFramework_thunk_pcwin64.dll" libFramework_thunk_pcwin64.c
Bibliothek "libFramework_thunk_pcwin64.lib" und Objekt "libFramework_thunk_pcwin64.exp" werden erstellt.
LIBCMT.lib(dllcrt0.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp__GetCurrentThreadId@0" in Funktion "__CRT_INIT@12".
LIBCMT.lib(tidtable.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "__imp__GetCurrentThreadId@0".
LIBCMT.lib(gs_support.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "__imp__GetCurrentThreadId@0".
LIBCMT.lib(onexit.obj) : error LNK2001: Nicht aufgelöstes externes Symbol "__imp__DecodePointer@4".
LIBCMT.lib(crtmboxw.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp__DecodePointer@4" in Funktion "___crtMessageBoxW".
<snip>
libFramework_thunk_pcwin64.dll : fatal error LNK1120: 65 nicht aufgelöste externe Verweise.
Error in load_Framework (line 4)
loadlibrary 'libFramework' 'Shaddower_C.h'
Unfortunately these errors are in German as I use german software. The (looslely) translation is, that there are links to non-solvable external symbols in different functions. If you know how to change the language to English, I can give you the exact output.
As I googled, I found out, that all functions I tried were from standard libraries, I just found some of the rundll32.dll but maybe there are other links as well.
In fact it seems, that the compiler is not able to access the default windows dll (or the sdk).
Can you tell me what's going wrong here?
PS: For those who understand the German language see http://www.gomatlab.de/viewtopic,p,91154.html#91154 I posted on a pure matlab forum fist, but as I guess it's a VC++ problem I also posted here.