带有 x64 标志 c++ 的未解析外部符号
我有一个 VS2008 C++ 项目,目前我在 VS2010 上编译。 它包含一个 dll 和执行 GUI 项目。
使用 x64 标志,构建 dll 时没有任何错误,但 GUI 在 dll 中运行时存在一些 LNK 错误。 “无法解析的外部符号...”(错误 LNK 2019 和 2001) 使用 Win32 标志时,没有 LNK 错误。
例如我有错误:
unresolved external symbol "public :void _cdecl aaa::bbb(void)*(?bbb@aaa@@QEAAXXZ) referenced in function "public:__cdecl ccc::ccc(class aaa &)" (??0@@QEAA@AEAVaaa@@@Z)
我在 x64 操作系统上运行。
有什么帮助吗?
I have a VS2008 C++ project which currently I compiled on VS2010.
it contains a dll and execution GUI project.
With x64 flag the dll is build without any errors but the GUI has some LNK errors to function that are in the dll. "unresolved external symbol..." (error LNK 2019 and 2001)
with Win32 flag there is no LNK errors.
for example I have the error:
unresolved external symbol "public :void _cdecl aaa::bbb(void)*(?bbb@aaa@@QEAAXXZ) referenced in function "public:__cdecl ccc::ccc(class aaa &)" (??0@@QEAA@AEAVaaa@@@Z)
I'm running on x64 OS.
Any help please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我了解,您的问题如下:
您的解决方案包含一个类库项目和一个提供用户界面的某种应用程序项目。
当设置为 win32 位环境时,您的解决方案编译没有问题,但在为 x64 位环境编译时显示链接器错误。
针对 x64 环境进行编译时,很可能无法找到 GUI 引用的类库项目输出。
我建议您尝试将配置管理器设置为将类库项目构建为 x64 或 Win32 以匹配您的 GUI 项目。
检查您的项目配置是否未将类库构建到特定于环境类型的目录,并确保您的 GUI 项目使用对类库项目的引用,而不是对输出 DLL 的引用。
还要检查您的 dll 是否确实是在 x64 环境下构建的。
还可能值得检查您的类库项目是否不使用任何旧的 Win32 特定库。
As I understand it your problem is as follows:
Your solution contains a class library project and an application project of somesort that provides the user interface.
Your solution compiles without problem when set for win32 bit environment, but shows linker errors when compiled for x64 bit environment.
It is likely that your class library project output, as referenced by the GUI cannot be found when compiling for the x64 environment.
I would suggest that you try setting your configuration manager to build your class library project as x64 or Win32 to match your GUI project.
Check that your project configuration doesn't build the class library to a directory specific to the environment type and ensure that your GUI project uses a reference to the class library project and not the output DLL.
Also check that your dll actually builds under for the x64 environment.
It may also be worth checking that your class library project doesn't use any old Win32 specific libraries.
如果我理解正确的话,您会想要构建一个 GUI 可执行文件,并需要将其链接到您的自定义 dll。所描述的错误可能由于多种原因而发生,但我想到的是:
你的动态链接库
If I understand this right you would like to build a GUI executable and need to link this against your custom dll. The described error might occure because of several reasons but this is what comes to mind:
your dll