Probleme bei ersten Gehversuchen mit wxWidgets unter Debian Linux
-
Hallo,
ich versuche mich gerade an wxWidgets mit Hilfe von Eclipse Galileo und G++ unter Debian. Ich bin mir nicht sicher, ob das mit der Installation alles glatt gelaufen ist.
Eine "HelloWorld" Applikation in der Console funktioniert in Eclipse erstmal. Nun zu meinem Problem. Ich habe im Netz verschiedene Beispiel für wxWidgets angeschaut und habe diese auch ausprobieren wollen. Ich bekomme beim Kompilieren aber folgende Fehlermeldungen bzw. Ausgabe:
**** Build of configuration Debug for project Simple ****
make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
In file included from ../main.cpp:1:
../main.h:4: error: expected class-name before ‘{’ token
In file included from ../main.cpp:2:
../simple.h:4: error: expected class-name before ‘{’ token
../simple.h:6: error: ISO C++ forbids declaration of ‘wxString’ with no type
../simple.h:6: error: expected ‘,’ or ‘...’ before ‘&’ token
../main.cpp:6: error: expected constructor, destructor, or type conversion before ‘bool’
make: *** [main.o] Fehler 1EDIT: Hier sind mal noch die Quelltexte:
simple.h
--------
#include <wx-2.8/wx/wx.h>class Simple : public wxFrame
{
public:
Simple(const wxString& title);
};simple.cpp
----------
#include "simple.h"Simple::Simple(const wxString& title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150))
{
Centre();
}main.h
------
#include <wx-2.8/wx/wx.h>class MyApp : public wxApp
{
public:
virtual bool OnInit();
};main.cpp
--------
#include "main.h"
#include "simple.h"IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
Simple *simple = new Simple(wxT("Simple"));
simple->Show(true);return true;
}Kann mir von euch einer weiterhelfen? Vielen Dank im voraus.
lg Torsten
-
Ich habe einen Fehler bereits gefunden, lag am Verzeichnis wo die Bibliotheken zu finden sind (ich bin Neueinsteiger in Sachen Linux).
Nun kann ich aber noch immer nicht kompilieren, ich denke das hängt irgendwie mit dem Tool wx-config zu tun. Wie und was muss ich denn in Eclipse einstellen, dass es funktioniert?
Nochmals vielen Dank im voraus.
lg Torsten