vc6.0下如何实现wxwindows框架的程序
最近在学习《c++核心思想》一书在522页有这样一个程序:
#include<wx/wx.h>
/* a basic application that shows an empty frame
*/
class BasicApp:public wxApp //wxwindow框架的函数名都是以大写的字母开头的
{
public:
/*constructs the frame.*/
BasicApp();
/*shows the frame. return true*/
virtual bool OnInit();
private:
wxFrame* frame;
};
DECLARE_APP(BasicApp)
IMPLEMENT_APP(BasicApp)
BasicApp::BasicApp()
{
frame=new wxFrame(NULL,-1,"Yes,I can!");
}
bool BasicApp::OnInit ()
{
frame->Show(true);
return true;
}
我在网上下了个wxWidgets-2.8.7编译并搭建了开发环境:
编译通过
但build:
------------------Configuration: 图形界面test001 - Win32 Debug--------------------
Linking...
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _calloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _toupper already defined in LIBCD.lib(toupper.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strchr already defined in LIBCD.lib(strchr.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strncmp already defined in LIBCD.lib(strncmp.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _tolower already defined in LIBCD.lib(tolower.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strstr already defined in LIBCD.lib(strstr.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _memmove already defined in LIBCD.lib(memmove.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _realloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strtol already defined in LIBCD.lib(strtol.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _strtoul already defined in LIBCD.lib(strtol.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _abort already defined in LIBCD.lib(abort.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __close already defined in LIBCD.lib(close.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __write already defined in LIBCD.lib(write.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __commit already defined in LIBCD.lib(commit.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __get_osfhandle already defined in LIBCD.lib(osfinfo.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __open_osfhandle already defined in LIBCD.lib(osfinfo.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __snprintf already defined in LIBCD.lib(snprintf.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __CrtSetDbgFlag already defined in LIBCD.lib(dbgheap.obj)
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
wxmsw28d_core.lib(app.obj) : error LNK2001: unresolved external symbol __imp__InitCommonControls@0
wxmsw28d_core.lib(statbr95.obj) : error LNK2001: unresolved external symbol __imp__CreateStatusWindowA@16
wxmsw28d_core.lib(spinbutt.obj) : error LNK2001: unresolved external symbol __imp__CreateUpDownControl@48
wxmsw28d_core.lib(listctrl.obj) : error LNK2001: unresolved external symbol __imp__ImageList_GetIconSize@12
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_GetIconSize@12
wxmsw28d_core.lib(listctrl.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Draw@24
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Draw@24
wxmsw28d_core.lib(listctrl.obj) : error LNK2001: unresolved external symbol __imp__ImageList_GetImageCount@4
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_GetImageCount@4
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Create@20
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Create@20
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Destroy@4
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Destroy@4
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Add@12
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Add@12
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_AddMasked@12
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_ReplaceIcon@12
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_ReplaceIcon@12
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Replace@16
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_Remove@8
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_SetBkColor@8
wxmsw28d_core.lib(imaglist.obj) : error LNK2001: unresolved external symbol __imp__ImageList_GetIcon@12
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_SetDragCursorImage@16
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_BeginDrag@16
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_EndDrag@0
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_DragMove@8
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_DragEnter@12
wxmsw28d_core.lib(dragimag.obj) : error LNK2001: unresolved external symbol __imp__ImageList_DragLeave@4
wxmsw28d_core.lib(uuid.obj) : error LNK2001: unresolved external symbol __imp__UuidToStringA@8
wxmsw28d_core.lib(uuid.obj) : error LNK2001: unresolved external symbol __imp__RpcStringFreeA@4
wxmsw28d_core.lib(uuid.obj) : error LNK2001: unresolved external symbol __imp__UuidCreate@4
wxmsw28d_core.lib(uuid.obj) : error LNK2001: unresolved external symbol __imp__UuidFromStringA@8
Debug/图形界面test001.exe : fatal error LNK1120: 25 unresolved externals
执行 link.exe 时出错.
图形界面test001.exe - 1 error(s), 0 warning(s)
这是怎么回事呀?
跪求各位高手看看,指点指点~~~~~!!!!