wxWindows problem

Tags:    c++ grafik

Jeg håber der er nogen her inde på udvikleren.dk der har arbejdet med wxWindows cross-platform GUI... når jeg kompilerer en af de medfulgte samples skriver den sådan her:

--------------------Configuration: MinimalVC - Win32 Release DLL--------------------
Linking...
wx.lib(main.obj) : error LNK2005: _WinMain@16 already defined in minimal.obj
LINK : warning LNK4049: locally defined symbol ""protected: static struct wxEventTable const wxFrame::sm_eventTable" (?sm_eventTable@wxFrame@@1UwxEventTable@@B)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxApp::wxApp(void)" (??0wxApp@@QAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall wxApp::~wxApp(void)" (??1wxApp@@UAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""class wxApp * wxTheApp" (?wxTheApp@@3PAVwxApp@@A)" imported
LINK : warning LNK4049: locally defined symbol ""int __cdecl wxEntry(void *,void *,char *,int,bool)" (?wxEntry@@YAHPAX0PADH_N@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxString::~wxString(void)" (??1wxString@@QAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxPoint::wxPoint(int,int)" (??0wxPoint@@QAE@HH@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxSize::wxSize(int,int)" (??0wxSize@@QAE@HH@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxString::wxString(char const *,unsigned int)" (??0wxString@@QAE@PBDI@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall wxFrame::~wxFrame(void)" (??1wxFrame@@UAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual void __thiscall wxFrameBase::SetStatusText(class wxString const &,int)" (?SetStatusText@wxFrameBase@@UAEXABVwxString@@H@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual class wxStatusBar * __thiscall wxFrameBase::CreateStatusBar(int,long,int,class wxString const &)" (?CreateStatusBar@wxFrameBase@@UAEPAVwxStatusBar@@HJHABVwxString@@@Z)" imported
LINK : warning LNK4049: locally defined symbol ""char const * const wxStatusLineNameStr" (?wxStatusLineNameStr@@3PBDB)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual void __thiscall wxFrame::SetMenuBar(class wxMenuBar *)" (?SetMenuBar@wxFrame@@UAEXPAVwxMenuBar@@@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxMenuBar::wxMenuBar(void)" (??0wxMenuBar@@QAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall wxMenuBase::Append(int,class wxString const &,class wxString const &,bool)" (?Append@wxMenuBase@@QAEXHABVwxString@@0_N@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxMenu::wxMenu(long)" (??0wxMenu@@QAE@J@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall wxIcon::~wxIcon(void)" (??1wxIcon@@UAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual void __thiscall wxFrame::SetIcon(class wxIcon const &)" (?SetIcon@wxFrame@@UAEXABVwxIcon@@@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxIcon::wxIcon(class wxString const &,long,int,int)" (??0wxIcon@@QAE@ABVwxString@@JHH@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxFrame::wxFrame(class wxWindow *,int,class wxString const &,class wxPoint const &,class wxSize const &,long,class wxString const &)" (??0wxFrame@@QAE@PAVwxWindow@@HABVwxString@@ABV
wxPoint@@ABVwxSize@@J1@Z)" imported
LINK : warning LNK4049: locally defined symbol ""char const * const wxFrameNameStr" (?wxFrameNameStr@@3PBDB)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall wxMenu::~wxMenu(void)" (??1wxMenu@@UAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall wxMenuBar::~wxMenuBar(void)" (??1wxMenuBar@@UAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: bool __thiscall wxWindowBase::Close(bool)" (?Close@wxWindowBase@@QAE_N_N@Z)" imported
LINK : warning LNK4049: locally defined symbol ""int __cdecl wxMessageBox(class wxString const &,class wxString const &,long,class wxWindow *,int,int)" (?wxMessageBox@@YAHABVwxString@@0JPAVwxWindow@@HH@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: int __cdecl wxString::Printf(char const *,...)" (?Printf@wxString@@QAAHPBDZZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall wxString::wxString(void)" (??0wxString@@QAE@XZ)" imported
minimal.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall wxAppInitializer::wxAppInitializer(class wxApp * (__cdecl*)(void))" (__imp_??0wxAppInitializer@@QAE@P6APAVwxApp@@XZ@Z)
minimal.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall wxMenu::wxMenu(class wxString const &,long)" (__imp_??0wxMenu@@QAE@ABVwxString@@J@Z)
ReleaseDLL/minimal.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

minimal.exe - 4 error(s), 28 warning(s)

Jeg har i visual c++ måtte ændre wx22_9.lib til wx.lib under object/library modules. Jeg går udfra at det er det, der er meningen da der ikke er nogen fil der hedder wx22_9.lib.

Er der nogen der ved hvad der er galt?



1 svar postet i denne tråd vises herunder
0 indlæg har modtaget i alt 0 karma
Sorter efter stemmer Sorter efter dato
Problemet er nok at du ikke linker det rigtige lib ind i din applikation. Afhaengig af dine projekt-settings, skal du linke paa foelgende maade:


debug dll: wx22_9d.lib
debug statisk: wxd.lib

release dll: wx22_9.lib
release statisk: wx.lib

Er du sikker paa den ikke ligger der et sted? Maaske har linkeren den bare ikke i sin path...



t