Markus Neteler wrote:

> > extern "C"
> > {
> > #include <grass/gis.h>
> > }
> >
> > and it worked, just in case other people finds the same problem.
> 
> Glad you found it. I have added a note to
> http://grass.osgeo.org/wiki/GRASS_and_C++
> 
> (please expand that Wiki page)

If it's considered desirable to be able to use GRASS from C++, the
headers' contents should be bracketed with:

        #ifdef __cplusplus
        extern "C" {
        #endif

        ...

        #ifdef __cplusplus
        }
        #endif

Without the 'extern "C" ...' qualification, C++ assumes that functions
have C++ linkage, meaning that the parameter types are embedded in the
symbol name (C++ allows function overloading, where multiple functions
can have the same name provided that they have different parameter
types).

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to