开发者

Explicit/implicit loading of a dll from a mex file

My question is a possible duplicate of this: matlab mex files and C++ dll (windows), however not exactly.

When I try to explicitly load a dll from a Matlab's mex file (Visual Studio 2008, Windows 7 64bit, Matlab 2010b), The loading fails at runtime (I get a NULL handle). The same code works ok when used not in the mex file.

When I try to implicitly load, by linking to the .lib file, I get a linker error of unresolved external symbol regarding the functions defined in the dll. Again, the same code works ok when used not in the mex file.

Is the reason the same as in the answer of the above SO question, or am I missing something? If the reason is the same, is there another soluti开发者_如何学Pythonon except the one suggested in the above question?


I assume your code is using the Windows function LoadLibrary. You should check the return from GetLastError to see why the LoadLibrary call fails.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜