VC++,与 wxWidgets、x64 的链接错误 [英] VC++, linking error with wxWidgets, x64

查看:35
本文介绍了VC++,与 wxWidgets、x64 的链接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 wxWidgets 2.8 在 Windows 7 x64 上编译 VC++ 10 应用程序.这是我的错误.代码是使用 wxFormBuilder 生成的.

I'm compiling a VC++ 10 application on Windows 7 x64 with wxWidgets 2.8. And this is the errors I have. The code is generated using wxFormBuilder.

更新:我也尝试在 32 位机器上运行它,仍然有同样的问题.

Update: I try to run it on 32-bit machine as well, still having the same problem.

我不知道我错过了哪些 wxwidgets 库,或者我做错了什么设置.在调试和发布模式下都尝试过.

I have no idea which wxwidgets libraries I'm missing out, or what settings did I do it wrong. Tried both in Debug and Release mode.

如果有人能指出一些提示,我将不胜感激!关注这个问题有一段时间了.

I'd really appreciate if someone could point to some hints! Been looking at this problem for a while.


1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition@@3VwxPoint@@B)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition@@3VwxPoint@@B)
1>ControlDialog.obj : error LNK2019: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition@@3VwxPoint@@B) referenced in function "public: void __cdecl ControlDialog::loadFile(class std::basic_string,class std::allocator >)" (?loadFile@ControlDialog@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition@@3VwxPoint@@B)
1>MainFrame.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition@@3VwxPoint@@B)
1>MainFrame.obj : error LNK2019: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos@wxStringBase@@2_KB) referenced in function "public: __cdecl MainFrame::MainFrame(class wxWindow *,class UIApp *)" (??0MainFrame@@QEAA@PEAVwxWindow@@PEAVUIApp@@@Z)
1>UIApp.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos@wxStringBase@@2_KB)
1>VISUI.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos@wxStringBase@@2_KB)
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos@wxStringBase@@2_KB)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos@wxStringBase@@2_KB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos@wxStringBase@@2_KB)
1>Helper.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos@wxStringBase@@2_KB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos@wxStringBase@@2_KB)
1>MainFrame.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PEBDEB)
1>UIApp.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PEBDEB)
1>VISUI.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PEBDEB)
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PEBDEB)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PEBDEB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PEBDEB)
1>Helper.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PEBDEB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString@@3PEBDEB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "class wxMBConvUTF8 & wxConvUTF8" (?wxConvUTF8@@3AEAVwxMBConvUTF8@@EA)
1>Helper.obj : error LNK2001: unresolved external symbol "class wxMBConvUTF8 & wxConvUTF8" (?wxConvUTF8@@3AEAVwxMBConvUTF8@@EA)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const wxGLCanvas::sm_eventTable" (?sm_eventTable@wxGLCanvas@@1UwxEventTable@@B)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "char const * const wxFrameNameStr" (?wxFrameNameStr@@3QBDB)
1>VISUI.obj : error LNK2001: unresolved external symbol "char const * const wxFrameNameStr" (?wxFrameNameStr@@3QBDB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxPalette wxNullPalette" (?wxNullPalette@@3VwxPalette@@A)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxCursor wxNullCursor" (?wxNullCursor@@3VwxCursor@@A)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_NULL" (?wxEVT_NULL@@3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_ERASE_BACKGROUND" (?wxEVT_ERASE_BACKGROUND@@3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_PAINT" (?wxEVT_PAINT@@3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_SIZE" (?wxEVT_SIZE@@3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_IDLE" (?wxEVT_IDLE@@3HB)

我正在链接的库(64 位 wxwidgets 库)

The libraries I'm linking against (64-bit wxwidgets libraries)

wxbase28.libwxmsw28_core.libwxmsw28_richtext.libwxmsw28_html.libwxmsw28_gl.libwxmsw28_adv.libcomctl32.libRpcrt4.lib

我的编译设置:

  • 将 Wchat_t 视为内置类型:是
  • 多线程调试DLL

推荐答案

我找到了解决我自己问题的方法.只是在这里发布以防万一有人遇到它.

I found the solution to my own problem. Just post here in case anyone faces it.

这与 x64 或 x32 无关,也与 wxWidgets 无关.我只需要在标题中添加这两行(在 #include #include 之前)

It's not about x64 or x32, neither about wxWidgets. I just need to add these 2 lines in header (before #include <wx/wx.h>)

#define __WXMSW__
#define WXUSINGDLL

这篇关于VC++,与 wxWidgets、x64 的链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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