|
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.
|
|
From: Carlos d. M. <cg...@wo...> - 2002-10-22 18:21:29
|
I decided give a try to wxwindows 233, what I achieve is that when I use msys ./configure, it says checking for flex... lex, after make it arrives a point when it pass over lexer.1 and says lex: command not found. With cmd.exe make -f makefile.g95 makedir cannot create dirs and cpy cannot copy (file does not exist) With msys make it starts to compile till a notebook.cpp, where it reports a lot of errors: undefined variables and parse errors. |
|
From: michel.weinachter <mic...@fr...> - 2003-04-26 19:54:05
|
(bonjour,)
hello,
You could find in your dev-c++ directory a new folder docs with various
files. The most important is wx.chm file.
Zero : read "topics overview"->
*Notes on using the reference* <wx450.htm#referencenotes>
*Writing a wxWindows application: a rough guide* <wx451.htm#roughguide>
*wxWindows Hello World sample* <wx452.htm#helloworld>
*wxWindows samples* <wx453.htm#samples>
*wxApp overview* <wx454.htm#wxappoverview>
First create a new wxwindows project and read the comments.
Second compile it click on the classes tab : you now have the list off
all the classes of the project .
You could also add in the editor properties->completion the file
include\wx\wx.h (very useful).
you can create a button add
wxButton *toto= new wxButton(frame, 2, "this is a test");
toto->SetBackgroundColour(wxColour(120,0,0));
just after :
---------
bool MyApp::OnInit()
{
// create the main application window
MyFrame *frame = new MyFrame(_T("Minimal wxWindows App"),
wxPoint(50, 50), wxSize(450, 340));
-------------
this way is not the best, but it's very simple.
You could download wxwindows for windows at :
http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.4.0-setup.zip
In the samples directory you will find a lot of examples
and
http://prdownloads.sourceforge.net/wxwindows/wxWindows-2.4.0-WinHelp.
for the winhelp file that you can add to the dev-cpp help menu.
finaly, if you want build complex apps use the xrc contrib (that should
be in the main library soon). To edit xrc files I am using xrced
provided with wxPython.
bye
|