This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GtkSpell Link Error


Hi PEACEYALL,

Is gtkspell C++ savvy?

You should see something like this in the gtkspell header files if they are
C++ savvy:

----------------------------------------------------------------------
#ifdef HEADERGUARD
#define HEADERGUARD

#include "blah.h" // headers that gtkspell's header depends on

#ifdef __cplusplus
extern "C" {
#endif

//...the meat of the header...

#ifdef __cplusplus
}
#endif

#endif // HEADERGUARD
----------------------------------------------------------------------

If the gtkspell headers are NOT C++ savvy, you'll should instrument them
by-hand with the __cplusplus bits above.

Alternatively (but not recommended by me), you might try to attempt a proxy
header:

my_gtkspell.hpp
----------------------------------------------------------------------
extern "C" {
#include "gtkspell.h"
}
----------------------------------------------------------------------

The reason I do not recommend this approach is because the extern "C" is
also (perhaps incorrectly) applied to any #include headers that gtkspell.h
itself includes, and those headers may get befuddled and you end up in a
much worse mess.

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]