|
From: Carlos d. M. <cg...@wo...> - 2002-06-25 17:58:48
|
Hi:
I downloaded wxwindows from its home page, and now I am having trouble
for compile a simple hello demo, I got a great amount of linker errors I
don't see how to solve, I sent this message to wxwindows mailing list
and in that archive I don't find the solution. Thinking there can be
somebody who uses wxwindows but is not in its mailing list, I write this
here, too:
I used as project options either console and windows application, but
the errors are the same.
The code of the hello demo:
/*
* hworld.cpp
* Hello world sample by Robert Roebling
*/
#define __GNUWIN32__ //two underscores before, two after the word. You
have to include them in the demo
#define __WXMSW__ //code. They are not in the sample due to...[tired
of writing]
#define UNICODE //It is defined in the demo
#include "wx/wx.h"
class MyApp: public wxApp
{
virtual bool OnInit();
};
class MyFrame: public wxFrame
{
public:
MyFrame(const wxString& title, const wxPoint& pos, const wxSize&
size);
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
enum
{
ID_Quit = 1,
ID_About,
};
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_Quit, MyFrame::OnQuit)
EVT_MENU(ID_About, MyFrame::OnAbout)
END_EVENT_TABLE()
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( "Hello World", wxPoint(50,50),
wxSize(450,340) );
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const
wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
{
wxMenu *menuFile = new wxMenu;
menuFile->Append( ID_About, "&About..." );
menuFile->AppendSeparator();
menuFile->Append( ID_Quit, "E&xit" );
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append( menuFile, "&File" );
SetMenuBar( menuBar );
CreateStatusBar();
SetStatusText( "Welcome to wxWindows!" );
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox("This is a wxWindows Hello world sample",
"About Hello World", wxOK | wxICON_INFORMATION, this);
}
THe linker errors:
d:\devpro\wx\hworld.o: In function
`_7MyFrameRC8wxStringRC7wxPointRC6wxSize':
//C/Dev-Cpp/Include/wx/string.h:322: undefined reference to
`wxString::InitWith(unsigned wchar_t const *, unsigned int, unsigned
int)'
//C/Dev-Cpp/Include/wx/string.h:322: undefined reference to
`wxString::InitWith(unsigned wchar_t const *, unsigned int, unsigned
int)'
//C/Dev-Cpp/Include/wx/string.h:322: undefined reference to
`wxString::InitWith(unsigned wchar_t const *, unsigned int, unsigned
int)'
//C/Dev-Cpp/Include/wx/string.h:322: undefined reference to
`wxString::InitWith(unsigned wchar_t const *, unsigned int, unsigned
int)'
//C/Dev-Cpp/Include/wx/string.h:322: undefined reference to
`wxString::InitWith(unsigned wchar_t const *, unsigned int, unsigned
int)'
d:\devpro\wx\hworld.o://C/Dev-Cpp/Include/wx/string.h:322: more
undefined references to `wxString::InitWith(unsigned wchar_t const *,
unsigned int, unsigned int)' follow
C:\Dev-Cpp\Lib\/libwx.a(app.o)(.text+0x3ec):app.cpp: undefined reference
to `InitCommonControls@0'
C:\Dev-Cpp\Lib\/libwx.a(statbr95.o)(.text+0x4ce):statbr95.cpp: undefined
reference to `CreateStatusWindowA@16'
C:\Dev-Cpp\Lib\/libwx.a(utils.o)(.text+0x37e):utils.cpp: undefined
reference to `WSAStartup@8'
C:\Dev-Cpp\Lib\/libwx.a(utils.o)(.text+0x3a8):utils.cpp: undefined
reference to `gethostname@8'
C:\Dev-Cpp\Lib\/libwx.a(utils.o)(.text+0x3ca):utils.cpp: undefined
reference to `gethostbyname@4'
C:\Dev-Cpp\Lib\/libwx.a(utils.o)(.text+0x3e2):utils.cpp: undefined
reference to `gethostbyaddr@12'
C:\Dev-Cpp\Lib\/libwx.a(utils.o)(.text+0x402):utils.cpp: undefined
reference to `WSACleanup@0'
C:\Dev-Cpp\Lib\/libwx.a(droptgt.o)(.data+0x0):droptgt.cpp: undefined
reference to `IID_IUnknown'
C:\Dev-Cpp\Lib\/libwx.a(droptgt.o)(.data+0x4):droptgt.cpp: undefined
reference to `IID_IDropTarget'
C:\Dev-Cpp\Lib\/libwx.a(spinbutt.o)(.text+0x5b5):spinbutt.cpp: undefined
reference to `CreateUpDownControl@48'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x2db):imaglist.cpp: undefined
reference to `ImageList_Create@20'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x345):imaglist.cpp: undefined
reference to `ImageList_Destroy@4'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x3a6):imaglist.cpp: undefined
reference to `ImageList_GetImageCount@4'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x3e7):imaglist.cpp: undefined
reference to `ImageList_GetIconSize@12'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x45c):imaglist.cpp: undefined
reference to `ImageList_Add@12'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x4e6):imaglist.cpp: undefined
reference to `ImageList_AddMasked@12'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x54e):imaglist.cpp: undefined
reference to `ImageList_ReplaceIcon@12'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x5d4):imaglist.cpp: undefined
reference to `ImageList_Replace@16'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x667):imaglist.cpp: undefined
reference to `ImageList_ReplaceIcon@12'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x6d8):imaglist.cpp: undefined
reference to `ImageList_Remove@8'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x732):imaglist.cpp: undefined
reference to `ImageList_GetImageCount@4'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x833):imaglist.cpp: undefined
reference to `ImageList_SetBkColor@8'
C:\Dev-Cpp\Lib\/libwx.a(imaglist.o)(.text+0x86d):imaglist.cpp: undefined
reference to `ImageList_Draw@24'
C:\Dev-Cpp\Lib\/libwx.a(dataobj.o)(.data+0x0):dataobj.cpp: undefined
reference to `IID_IUnknown'
C:\Dev-Cpp\Lib\/libwx.a(dataobj.o)(.data+0x4):dataobj.cpp: undefined
reference to `IID_IEnumFORMATETC'
C:\Dev-Cpp\Lib\/libwx.a(dataobj.o)(.data+0x8):dataobj.cpp: undefined
reference to `IID_IUnknown'
C:\Dev-Cpp\Lib\/libwx.a(dataobj.o)(.data+0xc):dataobj.cpp: undefined
reference to `IID_IDataObject'
I suspect I shall add some library, but I don't find what, I proved with
-lwx -lpjeg -lxpm[...] -lolexxx... but the errors remain there.
Thanks.
|