F
Fautvoir
The include files of gtkmm define a class named Glib::Interface.
My application defines a class in the global space named Interface.
I use this class Interface like this :
1) definition of class B :
#include <gtkmm.h>
class interface;
class C;
class B : public Gtk::Window // Gtk::Window est defined in gtkmm.h and
//the behind stuff.
{
Interface * interface;
C* cc;
....
};
Definition of class C :
class Interface;
class C
{
Interface * function();
....
};
In the constructor of B
#include "C.hh"
B::B(C* ccc) :
cc(ccc)
{
interface = cc->fonction(); // does't work with the following
//message on compiling time :
...
}
CMakeFiles/gestionnaire.dir/Gestion/IHM/Fenetre_principale.o
/home/thierry/Circuit/Gestion/IHM/Fenetre_principale.cc: In constructor
'Fenetre_principale::Fenetre_principale(Services*)':
/home/thierry/Circuit/Gestion/IHM/Fenetre_principale.cc:37: error:
cannot convert 'Interface*' to 'Glib::Interface*' in assignment
The class C definition gives the return value type of the C::function as
Glib::Interface then the definition of the class B makes the attribut
B.interface as Interface type.
I never ask to use the Glib namespace in any file,
I don't find any statement "using namespace xxx;" in the include files
of gtkmm (fine !!).
I don't understand why.
Thank for help.
My application defines a class in the global space named Interface.
I use this class Interface like this :
1) definition of class B :
#include <gtkmm.h>
class interface;
class C;
class B : public Gtk::Window // Gtk::Window est defined in gtkmm.h and
//the behind stuff.
{
Interface * interface;
C* cc;
....
};
Definition of class C :
class Interface;
class C
{
Interface * function();
....
};
In the constructor of B
#include "C.hh"
B::B(C* ccc) :
cc(ccc)
{
interface = cc->fonction(); // does't work with the following
//message on compiling time :
...
}
CMakeFiles/gestionnaire.dir/Gestion/IHM/Fenetre_principale.o
/home/thierry/Circuit/Gestion/IHM/Fenetre_principale.cc: In constructor
'Fenetre_principale::Fenetre_principale(Services*)':
/home/thierry/Circuit/Gestion/IHM/Fenetre_principale.cc:37: error:
cannot convert 'Interface*' to 'Glib::Interface*' in assignment
The class C definition gives the return value type of the C::function as
Glib::Interface then the definition of the class B makes the attribut
B.interface as Interface type.
I never ask to use the Glib namespace in any file,
I don't find any statement "using namespace xxx;" in the include files
of gtkmm (fine !!).
I don't understand why.
Thank for help.