Re: forward declarations of gtkmm stuff



On Jan 2, 2008 6:31 AM, Naveen Verma <ernaveenverma gmail com> wrote:
Hi,

Wt if you try to include only gtkmm.h?
#include <gtkmm.h>

That would work, but what I'm trying to  avoid  is not  the
clutter of include lines in the header file but the unnecessary
header file dependencies for cpp files that include foo.h. 
For example, if bar.cpp includes foo.h so that it can instantiate
a foo, it shouldn't need any gtkmm header dependencies. 
gtkmm.h makes the problem worse, because it includes lots of
gtkmm headers, so the compiler would have to grovel through
all of those headers to compile bar.cpp.

Thanks,

           David



-Br
Naveen

On Jan 2, 2008 4:11 PM, David L <idht4n gmail com> wrote:
Sorry if this is a stupid question, but how can I forward declare
gtkmm things so that gtkmm header files don't need to be
included before defining a class that has gtkmm pointers?

For example, I'd like to get rid of the two includes in this header file:
// foo.h
#include <gtkmm/window.h>
#include <gtkmm/radioaction.h>
class foo {
 public:
  foo();
 private:
  Gtk::Window *myWindow;
  Glib::RefPtr<Gtk::RadioAction> myRadioAction;
};



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]