VC ++,使用wxWidgets,x64链接错误 [英] VC++, linking error with wxWidgets, x64

查看:204
本文介绍了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.lib
wxmsw28_core.lib
wxmsw28_richtext.lib
wxmsw28_html.lib
wxmsw28_gl.lib
wxmsw28_adv.lib
comctl32 .lib
Rpcrt4.lib

我的编译设置:


  • 按内置类型处理Wchat_t:是

  • 多线程调试DLL

推荐答案

我找到了解决自己问题的方法。

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

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

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天全站免登陆