在什么条件下,你会得到未解决的外部符号__declspec(dllimport)? [英] Under what conditions will you get unresolved external symbol for __declspec(dllimport)?

查看:246
本文介绍了在什么条件下,你会得到未解决的外部符号__declspec(dllimport)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将应用程序转换为使用.dlls,并且我链接器错误说明

I am converting an application to use .dlls and I'm riddled with linker errors stating


未解决的外部
符号__declspec(dllimport)public:
void __thiscall
Rail :: SetNextrail(Class Rail *)

unersolved external symbol"__declspec(dllimport) public: void __thiscall Rail::SetNextrail(class Rail *)"

这个错误消息的结尾有更多的乱码。为什么会发生这种情况,你如何解决它? __declspec(dllimport)放置与宏定义为:

There is more gibberish at the end of this error message. Why should this happen and how do you fix it? __declspec(dllimport) is being placed with a macro defined as:

#ifdef LUDOAI_EXPORT
#define DECLSPECAI __declspec(dllexport)
#else
#define DECLSPECAI __declspec(dllimport)
#endif


推荐答案

我相信你需要做的是指定Railsimport library到链接器。使用GUI,它位于项目设置的链接器选项卡的其他库下。

I believe what you need to do is specify the Rails "import library" to the linker. Using the GUI, this is on the linker tab of project settings, under "additional libraries."

导入库是一个.LIB文件,到进口的相应图书馆。在.LIB文件的符号中是无条件跳转到导入表的相应地址进行导入。当你的代码调用一个导入,它真的调用这个存根在导入库,跳转到导入。

The "import library" is a .LIB file which contains symbols that resolve to the imports of the corresponding library. In the symbols from the .LIB file is an unconditional jump to the imports table's corresponding address for the import. When your code calls an import, it really calls this stub in the import library, which jumps to the import.

这篇关于在什么条件下,你会得到未解决的外部符号__declspec(dllimport)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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