You are not logged in.
I'm running Arch Linux with KDE over it. I have wxWidgets installed via the user repository, and for some reason, it won't work now with g++ `wx-config --libs` `wx-config --cxxflags` -o target target.cpp. It worked yesterday, but now it won't for whatever reason. The log is similar if not identical to compiling any other wxWidgets application since it stopped working. Even stranger, when I compile applications using Code::Blocks, they compile and run successfully. This is the code:
#include <wx/wx.h>
class MyFrame: public wxFrame
{
public:
MyFrame ( const wxString &title );
void OnQuit ( wxCommandEvent &event );
DECLARE_EVENT_TABLE()
};
class MyApp: public wxApp
{
public:
virtual bool OnInit ();
};
BEGIN_EVENT_TABLE( MyFrame, wxFrame )
EVT_BUTTON( wxID_EXIT, MyFrame::OnQuit )
END_EVENT_TABLE()
MyFrame::MyFrame ( const wxString &title )
: wxFrame( NULL, wxID_ANY, title, wxDefaultPosition, wxSize( 270, 150 ) )
{
wxPanel *panel= new wxPanel( this, wxID_ANY );
wxBoxSizer *sizer= new wxBoxSizer( wxVERTICAL );
wxBoxSizer *spacer= new wxBoxSizer( wxVERTICAL );
wxButton *button= new wxButton( panel, wxID_EXIT, _("Quit") );
sizer->Add( spacer, 1, wxEXPAND );
sizer->Add( button, 0, wxALIGN_BOTTOM | wxALIGN_RIGHT );
panel->SetSizer( sizer );
Center();
}
void MyFrame::OnQuit ( wxCommandEvent &WXUNUSED(event) )
{
Close( true );
}
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
MyFrame *frame= new MyFrame( _("This is a test app") );
frame->Show( true );
return true;
}
Here is a link to the log of the output:
http://wxforum.shadonet.com/download.php?id=1716
How do I go about getting my applications to compile again? Any help is greatly appreciated.
Offline
This isn't a compilation failure, it's a linker failure.
An undefined reference error means that some symbol is declared, but not defined.
The solution is usually to find the object file that defines the symbol and add it to the linker command.
Good ideas do not need lots of lies told about them in order to gain public acceptance.
Offline