Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > [gtkmm] confusing between Interface class in global space and Glib::Interfaceclass

Reply
Thread Tools

[gtkmm] confusing between Interface class in global space and Glib::Interfaceclass

 
 
Fautvoir
Guest
Posts: n/a
 
      08-08-2009
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.
 
Reply With Quote
 
 
 
 
Alf P. Steinbach
Guest
Posts: n/a
 
      08-08-2009
* 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;


Should be initial uppercase, probably.


> class C;
>
> class B : public Gtk::Window // Gtk::Window est defined in gtkmm.h and
> //the behind stuff.
>
> {
> Interface * interface;


Try

::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 :


Should probably be 'function'.


> ...
> }
>
> 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.


Please read the FAQ items on posting questions about code that doesn't work.

In particular, note that we're not telepaths (this should probably be a FAQ: Q:
"Are clc++ respondents telepaths?" A: "No, they're not"): we can't see the
*actual* code when you choose to not provide it, even if you're thinking of it.

I don't understand why so many people think that those who read their articles
must be telepaths, but, I've lamented over that umpteen times before, so if it's
any consolation: you're absolutely not alone in that (erroneous) belief.


Cheers & hth.,

- Alf
 
Reply With Quote
 
 
 
 
Fautvoir
Guest
Posts: n/a
 
      08-08-2009
Alf P. Steinbach a écrit :
> * Fautvoir:
>
>> class interface;

>
> Should be initial uppercase, probably.


Yes, it is
>
>
>> class C;
>>
>> class B : public Gtk::Window // Gtk::Window est defined in gtkmm.h
>> and //the behind stuff.
>>
>> {
>> Interface * interface;

>
> Try
>
> ::Interface* interface;
>


Yes, I did, i would like to undrestand why I have to
>
>> 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 :

>
> Should probably be 'function'.


yes
>
>
>> ...
>> }
>>

>
> Please read the FAQ items on posting questions about code that doesn't
> work.
>
> In particular, note that we're not telepaths (this should probably be a
> FAQ: Q: "Are clc++ respondents telepaths?" A: "No, they're not"): we
> can't see the *actual* code when you choose to not provide it, even if
> you're thinking of it.
>

OK; I'am sorry, I read the FAQ before, but the actual code seems to be
to big for a post and comments are in french. So the translation could
be confusing (see above).

> I don't understand why so many people think that those who read their
> articles must be telepaths, but, I've lamented over that umpteen times
> before, so if it's any consolation: you're absolutely not alone in that
> (erroneous) belief.
>
>
> Cheers & hth.,
>
> - Alf


Thank for your answer.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FWSM/PIX and Dynamic PAT using global IP range vs. global interface vs. global IP Hoffa Cisco 1 10-25-2006 06:50 PM
FWSM/PIX and Dynamic PAT using global IP range vs. global interface vs. global IP Hoffa Cisco 0 10-25-2006 01:04 PM
Why Python style guide (PEP-8) says 4 space indents instead of 8 space??? 8 space indents ever ok?? Christian Seberino Python 21 10-27-2003 04:20 PM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-23-2003 07:07 AM
Stack space, global space, heap space Shuo Xiang C Programming 10 07-11-2003 07:30 PM



Advertisments