[GRASS-dev] Compilation error on grass7-svn

Glynn Clements glynn at gclements.plus.com
Mon Mar 21 02:20:12 EDT 2011


Pierre Roudier wrote:

> I got the following error when compiling against the last update of
> the grass7 trunk:

> OBJ.x86_64-unknown-linux-gnu/strings.o -c strings.c
> strings.c:136: error: conflicting types for �G_str_replace�
> /usr/local/src/grass_trunk/dist.x86_64-unknown-linux-gnu/include/grass/gisdefs.h:580:
> note: previous declaration of �G_str_replace� was here

> Any suggestions?

Are you running "make" from the top-level directory, or are you trying
to compile just part of the tree?

r45541 modified the prototype for G_str_replace() in both
lib/gis/strings.c and include/gisdefs.h. Running "make" in the
"include" directory should install the updated gisdefs.h file to
dist.<arch>/include/grass/gisdefs.h, but this won't happen if you try
to build the "lib" or "lib/gis" directories alone.

In any case, running "make clean" first should fix the problem, even
though it shouldn't be necessary.

FWIW, the lines in question should be:

include/gisdefs.h:580:

	char *G_str_replace(const char *, const char *, const char *);

(and also for dist.<arch>/include/grass/gisdefs.h).

lib/gis/strings.c:136:

	char *G_str_replace(const char *buffer, const char *old_str, const char *new_str)

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list