wxwidgets wxwidgets include fehler



  • Hallo leute,

    seit ich versucht habe für mein Projekt eine einigermaßen flexible makefile zu schreiben kommt bei mir beim compilieren der main.cpp (da wo das haupt prog drin is) folgender komischer fehler:

    In file included from /usr/include/wx-2.8/wx/wx.h:45,
    from ../src/includes.h:6,
    from ../src/main.h:5,
    from ../src/main.cpp:1:
    /usr/include/wx-2.8/wx/image.h:432: Fehler: expected unqualified-id before »)« token

    meine makefile sieht so aus:

    # ~Umgebungsdefinitonen~ #

    #wxWidgets Config
    Libs = `wx-config --libs`
    Flags = `wx-config --cxxflags`

    #Pfade und Namen
    SourcePath = ../src/
    ProgrammName = strukt

    #Compiler und Linker
    Compiler = g++ -c $(Flags) $(SourcePath)
    Linker = g++ $(Libs) -o $(ProgrammName)

    # ~Regeln~ #

    (ProgrammName):element.oStruktPanel.omain.oapp.o(ProgrammName): element.o StruktPanel.o main.o app.o (Linker) $(ProgrammName) app.o main.o element.o StruktPanel.o

    element.o: $(SourcePath)element.cpp (SourcePath)element.hpp(SourcePath)element.hpp (Compiler)element.cpp

    StruktPanel.o: $(SourcePath)StruktPanel.cpp (SourcePath)StruktPanel.hpp(SourcePath)StruktPanel.hpp (Compiler)StruktPanel.cpp

    main.o: $(SourcePath)main.cpp (SourcePath)main.h(SourcePath)main.h (Compiler)main.cpp

    app.o: $(SourcePath)app.cpp (SourcePath)app.h(SourcePath)app.h (Compiler)app.cpp

    und ich habe eine "includes.h" die von allen unterprogrammen includiert wird in der halt alle externen includes stehen und so:

    using namespace std;
    /* wx Includes */
    
    #include <wx/wxprec.h>
    
    #ifndef WX_PRECOMP
    
        #include <wx/wx.h>
    
    #endif
    
    #include <wx/panel.h>
    
    #include <wx/stattext.h>
    #include <wx/dcclient.h>
    #include <wx/msgdlg.h> 
    
    /* C++ Includes */
    
    #include <iostream>
    #include <string>
    #include <cstring>
    #include <stdlib.h>
    #include <fstream>
    #include <sstream>
    
    #include <vector>
    #include <string.h>
    
    /* ObjectIncludes */
    
    #include "element.hpp"
    #include "StruktPanel.hpp"
    

    Hat jemand ne Idee woher das kommt?

    Achja, wenn man alles in einem VOrgang kompiliert gehts...

    Grüezi,
    Jan



  • GreenDelta schrieb:

    Achja, wenn man alles in einem VOrgang kompiliert gehts...

    Na dann ist doch super 😉

    Noch was: benutze nach möglichkeit kein using namespace ... in header-files 🙂


Anmelden zum Antworten