Re: gimp-vs: gdk headers missing extern "C"



Le samedi 08 décembre 2007 à 12:20 +0000, Robert Pearce a écrit :
> On Fri, 7 Dec 2007, ole nielsby pils org wrote :
> >They go away if I wrap the include directive in my program:
> >
> >extern "C"{
> >#include <gtk/gtk.h>
> >}
> >
> >But I think this wrap is supposed to be in the headers - the
> >other packages (ATK_, GTK_, PANGO_ etc.) work OK, using C linkage.
> 
> Yes, this wrapping is normally done in the headers, but because they are 
> fundamentally "C" headers and the wrapping is only valid in C++ it has 
> to be contained in a #ifdef. Though looking at the GTK headers, I think 
> this in turn is wrapped in magic ("G_BEGIN_DECLS"?)
> 
> Is it possible VC9 is not declaring the necessary symbol?

G_BENGIN_DECLS is defined in gmacros.h:

#ifdef  __cplusplus
# define G_BEGIN_DECLS  extern "C" {
# define G_END_DECLS    }
#else
# define G_BEGIN_DECLS
# define G_END_DECLS
#endif

__cplusplus should be defined automatically for c++ source files.

Regards,
Jean



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