[mapserver-dev] cplusplus within c?

Daniel Morissette dmorissette at mapgears.com
Thu Aug 13 07:57:18 EDT 2009

kiran varma wrote:
> I am trying to create a new function inside mapgd.c which makes use of 
> agg_svg_parser which makes use of c++(within namespace). How do i 
> exactly access cpp functionality inside the c file or do i have to 
> create a separate cpp file just for that function.

The simplest will be to create a mapsvgsymbol.cpp that will contain the 
functions that bridge the rest of the C code and the AGG SVG code.

Then you need to make sure your functions are prototyped inside an 
extern "C" { ...} block in the .h. Most of the contents of mapserver.h 
is inside such an extern "C" block already, so if you put the prototypes 
there you should be fine.

If you have any problem making this work please don't hesitate to ask, I 
should be on IRC today.

Daniel Morissette

More information about the mapserver-dev mailing list