为什么 Visual Studio 不能正确链接为针对 rundll 的 matlab mex 文件? [英] Why does Visual Studio not link correctly as a matlab mex file against the rundll?

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

问题描述

我有以下问题:我有一个 64 位版本的 matlab 2011b.我需要从 DLL 调用一些函数.前段时间,visual studio 2010 的 prof 版本一直在工作.

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.

现在我想让它运行 express 版本.因此,我安装了 Visual Studio C++ 2010 Express 和 Win 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!

如果我想用 loadlibrary 加载 dll 本身,我会收到大量错误.就像是:构建 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:MATLABR2011bexterninclude"   /W3  /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0  /nologo  -I"U:FrameworkFrameworkso" -I"U:FrameworkFrameworkso" "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.

当我用谷歌搜索时,我发现我尝试的所有函数都来自标准库,我只找到了一些 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 Redistributable 的软件包.我删除了它们以及安装的 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天全站免登陆