为什么mingw g ++编译器导致错误的链接结果?

时间:2012-05-30 13:49:00

标签: gcc linker mingw

我在linux下开发了一些(更大的)代码。一旦我意识到我需要它在Windows下我在linux下安装了一个交叉编译器,一切顺利。

现在代码应该在不需要虚拟机的情况下进一步管理。因此我安装了mingw并尝试在windows下编译代码。 我得到了一个没有任何警告或类似的DLL。

但: 一旦我尝试使用DLL(在Matlab中绑定它),我就会收到有关无法找到的模块的错误。使用Dependency walker我得到一个关于

的错误
At least one module has an unresolved import due to a missing export function in an implicitly dependent module.

我看到了,例如kernel32.dll中的函数InterlockedDecrement为红色(缺失)。在mingw安装中,我找到了一个libkernel32.a,根据这个函数有两个函数(nm的输出):

00000000 T _InterlockedDecrement@4
00000000 I __imp__InterlockedDecrement@4

到目前为止看起来相当不错。在c:\Windows\System32\kernel32.dll中,根据InterlockedDecrement,有一个函数pexport

所以我的问题是:这个错误来自哪里?我做错了什么?

0 个答案:

没有答案