为什么Visual Studio中不能正确作为对RUNDLL一个MATLAB MEX文件链接? [英] Why does Visual Studio not link correctly as a matlab mex file against the rundll?

查看:597
本文介绍了为什么Visual Studio中不能正确作为对RUNDLL一个MATLAB MEX文件链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:我有一个64位版本的MATLAB 2011B的。我需要从一个DLL调用一些功能。这已经工作一段时间前与Visual Studio 2010的教授版本。

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.

现在我想要得到它与前preSS版本上运行。因此,我安装了Visual Studio的C ++ 2010例preSS和赢SDK 7.1。现在我给MATLAB中的命令 MEX -setup 键,选择VC ++编译器。好吧!

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!

如果我想要加载DLL本身与调用LoadLibrary ,我得到吨的错误。就像是: 建筑libFramework_thunk_pcwin64失败。编译器的输出是:

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'

不幸的是,这些错误是在德国因为我用德国软件。在(looslely)翻译,有链接到不同功能的非可解外部符号。如果你知道如何更改语言为英文,我可以给你确切的输出。

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.

当我用Google搜索,我发现,我尝试了所有的功能都是由标准库,我只是发现了一些rundll32.dll的,但也许还有其他环节也是如此。

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.

其实现在看来,编译器是无法访问默认的Windows DLL(或SDK)。

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:对于那些谁懂德语看到 HTTP:// WWW。 gomatlab.de/viewtopic,p,91154.html#91154 我贴在一个纯粹的MATLAB论坛拳,但我想这是一个VC ++的问题,我也张贴在这里。

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.

推荐答案

我发现,我已经安装了约VS2010可再发行一些软件包。我删除了他们和VS2010安装和SDK。重新安装SDK之后都去正确的。

I found out, that I had some packages about VS2010 Redistributable installed. I deleted them and the installed VS2010 and the SDK. After reinstalling the SDK all went correct.

感谢

这篇关于为什么Visual Studio中不能正确作为对RUNDLL一个MATLAB MEX文件链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆