"Billig Fehler"



  • ich wollte ein Programm schreiben, hatte hab grad mal das grundgerüst
    aber ich bekomme einen Fehler. Das is mir jetz peinlich... aber ich find den nich.

    #include <wx/wx.h>
    #include "Nigotris.h"
    
    IMPLEMENT_APP(Nigotris)
    
    BEGIN_EVENT_TABLE(MainFrame, wxFrame)
    //Events
    END_EVENT_TABLE()
    
    bool Nigotris::OnInit()
    {
    	MainFrame *frame = new MainFrame(wxT("Nigotris 1.0"));
    	frame->Show(true);
    	return true;
    }
    
    MainFrame::MainFrame(const wxString &title)
    :wxFrame(NULL, wxID_ANY, title)
    {
    	Datei = new wxMenu();
    	Menu = new wxMenuBar();
    	Menu->Append(Datei, wxT("Datei"));
    
    	SetMenuBar(Menu);
    }
    

    und die *.h

    #ifndef _NIGOTRIS_H_
    #define _NIGOTRIS_H_
    
    class Nigotris : public wxApp
    {
    public:
    	virtal bool OnInit();
    };
    
    class MainFrame : public wxFrame
    {
    public:
    	MainFrame(const wxString &title);
    private:
    	DECLARE_EVENT_TABLE()
    	wxMenu *Datei;
    	wxMenuBar *Menu;
    };
    #endif
    

    Was is da jetz falsch? 😕

    lol...
    hätt ich fast vergessen:

    error C2144: Syntaxfehler: 'bool' sollte auf ';' folgen
    error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
    


  • In Zeile 7 der Headerdatei fehlt ein 'u' bei virtual:

    #ifndef _NIGOTRIS_H_
    #define _NIGOTRIS_H_
    
    class Nigotris : public wxApp
    {
    public:
        virtual bool OnInit();
    };
    
    class MainFrame : public wxFrame
    {
    public:
        MainFrame(const wxString &title);
    private:
        DECLARE_EVENT_TABLE()
        wxMenu *Datei;
        wxMenuBar *Menu;
    };
    #endif
    


  • grummel...
    stimmt du hast recht. Verdammt! 😡
    naja, aber danke 😃


Anmelden zum Antworten