[GRASS-dev] unknown reference to G__gisinit

Markus Neteler neteler at osgeo.org
Sat May 5 15:53:55 EDT 2012


On Sat, May 5, 2012 at 1:19 PM, Xavier Rubio <xrubio at gmail.com> wrote:
> Hi, thanks for your answers. Markus, I compared the compilation of
> "r.example" with my own system and realized that the only difference was the
> compiler (gcc or g++). Compiling my code with gcc worked, so the problem is
> the fact that I was developing C++ code to call a C function (the binary
> symbols are different, so it explains the errors).
> Fix this problem was rather easy; I specified the compiler that the gis.h
> include is C code:
>
> 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)

Markus


More information about the grass-dev mailing list