Seltsame Fehlermeldung beim compilieren meines FLTK Programms



  • Hallo zusammen,

    wenn ich mein FLTK Programm mit fltk-config --compile fltk.cpp compilieren möchte
    bekomme ich folgende Fehlermeldung:

    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-gnu/bits/c++config.h:43: error: expected unqualified-id before ‘namespace’
    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-gnu/bits/c++config.h:47: error: ‘__gnu_debug_def’ is not a namespace-name
    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-gnu/bits/c++config.h:47: error: expected namespace-name before ‘;’ token

    Kann mr jemand sagen woran das liegt und was ich an meinem Programm ändern muss ?!?
    Hier mal der Code dazu:

    fltk.h

    #include <FL/Fl.H>
    	#include <FL/Fl_Window.H>
    	#include <FL/Fl_Box.H>
    	#include<FL/Fl_Check_Button.H>
    	#include <FL/Fl_Return_Button.H>
    	#include <FL/Fl_Input.H>
    	#include <FL/Fl_Multiline_Input.H>
    	#include <FL/Fl_Button.H>
    	#include <FL/Fl_Output.H>
    
    	class std_window{
    
    		public:
    
    			std_window();
    			void show(int argc, char** argv);
    
    		private:
    
    			Fl_Window* window;
    			Fl_Box* box;
    			Fl_Return_Button* rbutton;
    			Fl_Button* exitbutton;
    
    			//static functions
    
    			 Fl_Input* inputuser;
    			 Fl_Output* output;
    
    			static void cb_value(Fl_Widget* w, void* data);
    			static void cb_exit(Fl_Widget* w);
    			static void cb_output(Fl_Widget* w, void* data);
    	}
    

    fltk.cpp

    #include "fltk.h"
    	#include <string>
    	#include <iostream>
    	using namespace std;
    
    	 std_window::std_window() {
    
    		window = new Fl_Window(500, 650);
    
    		window->begin();							//window begin
    
    		box = new Fl_Box(50, 40, 400, 500, NULL);
    
    		rbutton = new Fl_Return_Button(60,500,100,50);
    
    		exitbutton = new Fl_Button(300, 500, 100, 50,"EXIT");
    
    		box->box(FL_UP_BOX);
    		box->labelsize(15);
    		box->labelfont(FL_BOLD+FL_ITALIC);
    		box->labeltype(FL_SHADOW_LABEL);
    
    		window->end();						//window end
    
    		inputuser->callback(cb_value,(void*)this );
    		rbutton->callback(cb_output, (void*)this);
    		exitbutton->callback(cb_exit);
    
    	}
    
    	void std_window::cb_value(Fl_Widget* w, void* data) {
    		string temp;
    
    		Fl_Input* input =((std_window*)data)->inputuser;
    		temp = input->value();
    		cout<<temp;
    
    	}
    
    	void std_window::cb_output(Fl_Widget*w, void* data) {
    		Fl_Output* out = ((std_window*)data)->output;
    
    		out->value("Daten wurden übernommen");
    
    	}
    
    	void std_window::cb_exit(Fl_Widget* w) {
    
    		exit(1);
    	}
    


  • Omen777 schrieb:

    Hallo zusammen,

    wenn ich mein FLTK Programm mit g++ `fltk-config --cxxflags` -o fltk.o fltk.cpp compilieren möchte
    bekomme ich folgende Fehlermeldung:

    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-gnu/bits/c++config.h:43: error: expected unqualified-id before ‘namespace’
    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-gnu/bits/c++config.h:47: error: ‘__gnu_debug_def’ is not a namespace-name
    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-gnu/bits/c++config.h:47: error: expected namespace-name before ‘;’ token

    Kann mr jemand sagen woran das liegt und was ich an meinem Programm ändern muss ?!?
    Hier mal der Code dazu:

    fltk.h

    #include <FL/Fl.H>
    	#include <FL/Fl_Window.H>
    	#include <FL/Fl_Box.H>
    	#include<FL/Fl_Check_Button.H>
    	#include <FL/Fl_Return_Button.H>
    	#include <FL/Fl_Input.H>
    	#include <FL/Fl_Multiline_Input.H>
    	#include <FL/Fl_Button.H>
    	#include <FL/Fl_Output.H>
    
    	class std_window{
    
    		public:
    
    			std_window();
    			void show(int argc, char** argv);
    
    		private:
    			
    			Fl_Window* window;
    			Fl_Box* box;
    			Fl_Return_Button* rbutton;
    			Fl_Button* exitbutton;
    			
    			
    			//static functions
    
    			 Fl_Input* inputuser;
    			 Fl_Output* output;
    			
    			static void cb_value(Fl_Widget* w, void* data);
    			static void cb_exit(Fl_Widget* w);
    			static void cb_output(Fl_Widget* w, void* data);
    	}
    

    fltk.cpp

    #include "fltk.h"
    	#include <string>
    	#include <iostream>
    	using namespace std;
    
    	 std_window::std_window() {
    
    		window = new Fl_Window(500, 650);
    		
    		window->begin();							//window begin
    		
    		box = new Fl_Box(50, 40, 400, 500, NULL);
    		
    		rbutton = new Fl_Return_Button(60,500,100,50);
    	
    		exitbutton = new Fl_Button(300, 500, 100, 50,"EXIT");
    
    		box->box(FL_UP_BOX);
    		box->labelsize(15);
    		box->labelfont(FL_BOLD+FL_ITALIC);
    		box->labeltype(FL_SHADOW_LABEL);
    
    		window->end();						//window end
    
    		inputuser->callback(cb_value,(void*)this );
    		rbutton->callback(cb_output, (void*)this);
    		exitbutton->callback(cb_exit);
    
    		
    	}
    
    	void std_window::cb_value(Fl_Widget* w, void* data) {
    		string temp;
    		
    
    		Fl_Input* input =((std_window*)data)->inputuser;
    		temp = input->value();
    		cout<<temp;
    		
    	}
    	 
    
    	void std_window::cb_output(Fl_Widget*w, void* data) {
    		Fl_Output* out = ((std_window*)data)->output;
    
    		out->value("Daten wurden übernommen");
    
    	}
    
    	void std_window::cb_exit(Fl_Widget* w) {
    
    		exit(1);
    	}
    

Log in to reply