From: Philip on
Hi everybody,

I was wondering if it is possible to compile a mexw32 file in Matlab using the emlmex command and then use this mexw32 file as kind of a dll in visual studio 2008.
The goal would be to use the functions written in Matlab in your c++ visual studio code.

What I did for instant:
1: I compiled a mexw32 file from an * .m. The .m contains only one very simple function that returns one value. Inside the .m i declared
%#eml
assert(isa(zahl1,'double'));
assert(isa(zahl2,'double'));

2: I renamed the mexw32 to .dll
3: I added this .dll as a resource to my VS console project
4: I tried to import the dll in the way I usually do this with "normal" c++ dlls

extern "C" __declspec(dllimport)

5: I call the function inside the main considering output and input as double (as everything is double in matlab by default)


Well so what I got sofar:
1: error LNK2019: unresolved external symbol
2: fatal error LNK1120:

Does everybody have experience with this? As the threads that I found in the newsgroup are dealing with the "inverse problem": Compiling mexw32 in VS

Thanks a lot in advance

Philip