Re: gtkmm, cairo, and XLib



> > And here's another one from gtkmm 2.9:
> > 
> > displaymanager.cc: In function
> >
> 'void<unnamed>::DisplayManager_signal_display_opened_callback(GdkDisplayManager*,
> > GdkDisplay*, void*)':
> > displaymanager.cc:43: error: 'Display' was not
> > declared in this scope
> > 
> > Adding a typedef makes the problem clear:
> > 
> > displaymanager.cc:31: error: conflicting declaration
> > 'typedef class
> > Gdk::Display Display'
> > /usr/include/X11/Xlib.h:519: error: 'Display' has a
> > previous declaration
> > as 'typedef struct _XDisplay Display'
> > displaymanager.cc: In function
> >
> 'void<unnamed>::DisplayManager_signal_display_opened_callback(GdkDisplayManager*,
> > GdkDisplay*, void*)':
> 
> That one's quite different, surely.
> It's not a bug in Xlib.h.

A non-prefixed, non-namespaced "Display" symbol in Xlib.h is a bug as
far as I'm concerned.

> Unlike the other cases, you can fix it in Gdk by using
> the fully-qualified name, Gdk::Display, instead of
> using a typedef 

No, the original error was misleading. The typedef showed the real
problem.

> to pollute the global namespace.

It was in a .cc file.

I've just used #undef to fix this one case.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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