刚学习wxwidget和msvc++,遇到个问题

tnt32 2011-08-07 09:58:39
用 VS2010编译wxwidget无问题,但是写了一个main.cpp文件后,
无法通过链接。
请问大牛们是什么原因造成的。
谢谢。


1>------ Build started: Project: wxStudy3, Configuration: Debug Win32 ------
1>Build started 8/6/2011 9:57:48 PM.
1>InitializeBuildStatus:
1> Touching "Debug\wxStudy3.unsuccessfulbuild".
1>ClCompile:
1> main.cpp
1>wxmsw28ud_core.lib(app.obj) : error LNK2019: unresolved external symbol __imp__InitCommonControls@0 referenced in function "public: virtual bool __thiscall wxApp::Initialize(int &,wchar_t * *)" (?Initialize@wxApp@@UAE_NAAHPAPA_W@Z)
1>wxmsw28ud_core.lib(statbr95.obj) : error LNK2019: unresolved external symbol __imp__CreateStatusWindowW@16 referenced in function "public: bool __thiscall wxStatusBar::Create(class wxWindow *,int,long,class wxString const &)" (?Create@wxStatusBar@@QAE_NPAVwxWindow@@HJABVwxString@@@Z)
1>wxmsw28ud_core.lib(spinbutt.obj) : error LNK2019: unresolved external symbol __imp__CreateUpDownControl@48 referenced in function "public: bool __thiscall wxSpinButton::Create(class wxWindow *,int,class wxPoint const &,class wxSize const &,long,class wxString const &)" (?Create@wxSpinButton@@QAE_NPAVwxWindow@@HABVwxPoint@@ABVwxSize@@JABVwxString@@@Z)
1>wxmsw28ud_core.lib(listctrl.obj) : error LNK2019: unresolved external symbol __imp__ImageList_GetIconSize@12 referenced in function "bool __cdecl HandleSubItemPrepaint(struct tagNMLVCUSTOMDRAW *,struct HFONT__ *,int)" (?HandleSubItemPrepaint@@YA_NPAUtagNMLVCUSTOMDRAW@@PAUHFONT__@@H@Z)
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_GetIconSize@12
1>wxmsw28ud_core.lib(listctrl.obj) : error LNK2019: unresolved external symbol __imp__ImageList_Draw@24 referenced in function "bool __cdecl HandleSubItemPrepaint(struct tagNMLVCUSTOMDRAW *,struct HFONT__ *,int)" (?HandleSubItemPrepaint@@YA_NPAUtagNMLVCUSTOMDRAW@@PAUHFONT__@@H@Z)
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Draw@24
1>wxmsw28ud_core.lib(listctrl.obj) : error LNK2019: unresolved external symbol __imp__ImageList_GetImageCount@4 referenced in function "bool __cdecl HandleSubItemPrepaint(struct tagNMLVCUSTOMDRAW *,struct HFONT__ *,int)" (?HandleSubItemPrepaint@@YA_NPAUtagNMLVCUSTOMDRAW@@PAUHFONT__@@H@Z)
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_GetImageCount@4
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_Create@20 referenced in function "public: bool __thiscall wxImageList::Create(int,int,bool,int)" (?Create@wxImageList@@QAE_NHH_NH@Z)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Create@20
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_Destroy@4 referenced in function "public: virtual __thiscall wxImageList::~wxImageList(void)" (??1wxImageList@@UAE@XZ)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Destroy@4
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_Add@12 referenced in function "public: int __thiscall wxImageList::Add(class wxBitmap const &,class wxBitmap const &)" (?Add@wxImageList@@QAEHABVwxBitmap@@0@Z)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Add@12
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_AddMasked@12 referenced in function "public: int __thiscall wxImageList::Add(class wxBitmap const &,class wxColour const &)" (?Add@wxImageList@@QAEHABVwxBitmap@@ABVwxColour@@@Z)
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_ReplaceIcon@12 referenced in function "public: int __thiscall wxImageList::Add(class wxIcon const &)" (?Add@wxImageList@@QAEHABVwxIcon@@@Z)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_ReplaceIcon@12
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_Replace@16 referenced in function "public: bool __thiscall wxImageList::Replace(int,class wxBitmap const &,class wxBitmap const &)" (?Replace@wxImageList@@QAE_NHABVwxBitmap@@0@Z)
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_Remove@8 referenced in function "public: bool __thiscall wxImageList::Remove(int)" (?Remove@wxImageList@@QAE_NH@Z)
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_SetBkColor@8 referenced in function "public: bool __thiscall wxImageList::Draw(int,class wxDC &,int,int,int,bool)" (?Draw@wxImageList@@QAE_NHAAVwxDC@@HHH_N@Z)
1>wxmsw28ud_core.lib(imaglist.obj) : error LNK2019: unresolved external symbol __imp__ImageList_GetIcon@12 referenced in function "public: class wxIcon __thiscall wxImageList::GetIcon(int)const " (?GetIcon@wxImageList@@QBE?AVwxIcon@@H@Z)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2019: unresolved external symbol __imp__ImageList_SetDragCursorImage@16 referenced in function "public: bool __thiscall wxDragImage::BeginDrag(class wxPoint const &,class wxWindow *,bool,class wxRect *)" (?BeginDrag@wxDragImage@@QAE_NABVwxPoint@@PAVwxWindow@@_NPAVwxRect@@@Z)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2019: unresolved external symbol __imp__ImageList_BeginDrag@16 referenced in function "public: bool __thiscall wxDragImage::BeginDrag(class wxPoint const &,class wxWindow *,bool,class wxRect *)" (?BeginDrag@wxDragImage@@QAE_NABVwxPoint@@PAVwxWindow@@_NPAVwxRect@@@Z)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2019: unresolved external symbol __imp__ImageList_EndDrag@0 referenced in function "public: bool __thiscall wxDragImage::EndDrag(void)" (?EndDrag@wxDragImage@@QAE_NXZ)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2019: unresolved external symbol __imp__ImageList_DragMove@8 referenced in function "public: bool __thiscall wxDragImage::Move(class wxPoint const &)" (?Move@wxDragImage@@QAE_NABVwxPoint@@@Z)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2019: unresolved external symbol __imp__ImageList_DragEnter@12 referenced in function "public: bool __thiscall wxDragImage::Show(void)" (?Show@wxDragImage@@QAE_NXZ)
1>wxmsw28ud_core.lib(dragimag.obj) : error LNK2019: unresolved external symbol __imp__ImageList_DragLeave@4 referenced in function "public: bool __thiscall wxDragImage::Hide(void)" (?Hide@wxDragImage@@QAE_NXZ)
1>wxmsw28ud_core.lib(uuid.obj) : error LNK2019: unresolved external symbol __imp__UuidToStringW@8 referenced in function "public: __thiscall Uuid::Uuid(class Uuid const &)" (??0Uuid@@QAE@ABV0@@Z)
1>wxmsw28ud_core.lib(uuid.obj) : error LNK2019: unresolved external symbol __imp__RpcStringFreeW@4 referenced in function "public: __thiscall Uuid::~Uuid(void)" (??1Uuid@@QAE@XZ)
1>wxmsw28ud_core.lib(uuid.obj) : error LNK2019: unresolved external symbol __imp__UuidCreate@4 referenced in function "public: void __thiscall Uuid::Create(void)" (?Create@Uuid@@QAEXXZ)
1>wxmsw28ud_core.lib(uuid.obj) : error LNK2019: unresolved external symbol __imp__UuidFromStringW@8 referenced in function "public: bool __thiscall Uuid::Set(wchar_t const *)" (?Set@Uuid@@QAE_NPB_W@Z)
1>D:\Workspace\wxProject\wxStudy3\Debug\wxStudy3.exe : fatal error LNK1120: 25 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:04.11
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

...全文
276 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
whj2819 2011-12-08
  • 打赏
  • 举报
回复
谢谢,我也遇到这个问题。确实是少了comctl32.lib
rpcrt4.lib这两个文件。
至善者善之敌 2011-08-13
  • 打赏
  • 举报
回复
我一般有错误,又一时看不出问题的,直接粘贴到GOOGLE,百度,一般会有结果,大部分解决都是在ENGLISH网页或论坛上有类似的问题,看来国内共享精神太少!
jackyjkchen 2011-08-13
  • 打赏
  • 举报
回复
如果不是特别的需求,建议楼主用qt,wxwidget不太成熟,bug有点多……
贪食蛇男 2011-08-13
  • 打赏
  • 举报
回复
找不到符号问题一般比较好解决,确认一下符号所在的 lib 文件,加入工程配置。
如果嫌每次往工程加麻烦,可以设置系统环境变量 lib ,然后以后启动IDE时会自动把LIB中的目录加入到库文件搜索目录列表。
Lee_Cheng 2011-08-13
  • 打赏
  • 举报
回复
你应该少了两个lib
comctl32.lib
rpcrt4.lib

在sample的例子里写的比较清楚
zhangsongcui 2011-08-13
  • 打赏
  • 举报
回复
包含wxWidgets\include\msvc\wx\setup.h,那些#pragma comment神马的都写在里面
另外你编译的是UNICODE/MBCS、DEBUG/RELEASE要搞清楚,分别定义不同的宏
PS:前几天2.9.2都发布了
wjjjuniniho 2011-08-07
  • 打赏
  • 举报
回复
这个错误一般是编译器只有声明却没有找到实现,你去看看漏掉什么lib库之类的吧
ryfdizuo 2011-08-07
  • 打赏
  • 举报
回复
按照错误提示 添加一下lib文件。
wxmsw28ud_core.lib

64,639

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧