[GRASS5] [bug #2009] (grass) Compilation problems (NVIZ)

this bug's URL: http://intevation.de/rt/webrt?serial_num=2009
-------------------------------------------------------------------------

Subject: Compilation problems (NVIZ)

grass obtained from: Mirror of Trento site
grass binary for platform: Compiled from Sources
GRASS Version: 5.0.2

When compiling the part that compiles NVIZ returns the following error:

/grass5.0.2/src/CMD/gmake5.0 /grass5.0.2/src.contrib/GMSL/NVIZ2.2/src
#################################################################
/grass5.0.2/src.contrib/GMSL/NVIZ2.2/src
  make -f OBJ.powerpc-apple-darwin6.6/make.rules

gcc -I/grass5.0.2/src/include -g -O2 -D__unix -I/usr/X11R6/include -I/usr/local/include/ -I/
usr/local/include/ -I/grass5.0.2/src/libes/ogsf -D_NO_PROTO -D__STDC__ -I/usr/local/
pgsql/include/ -c nvizAppInit.c -o OBJ.powerpc-apple-darwin6.6/nvizAppInit.o
In file included from nvizAppInit.c:9:
interface.h:257: conflicting types for `Tk_SetAppName'
/usr/local/include//tkDecls.h:573: previous declaration of `Tk_SetAppName'
make[2]: *** [OBJ.powerpc-apple-darwin6.6/nvizAppInit.o] Error 1
make[1]: *** [nvwish] Error 2
GISGEN failure at STEP: src.contrib/GMSL/NVIZ2.2

I found a workaround, where I out-commented (/* */) line 257 in file: interface.h.

I used the following configure statement:

./configure --with-libs='/sw/lib/ /usr/lib/ /usr/local/lib/ /usr/X11R6/lib/' --with-readline --
with-x --with-gdal --with-postgres-includes=/usr/local/pgsql/include/ --with-postgres-
libs=/usr/local/pgsql/lib/ --with-ncurses-includes=/usr/include/ --with-opengl-includes=/
usr/X11R6/include/ --with-x-includes=/usr/X11R6/include/X11/ --with-png-includes=/sw/
include/libpng12/ --with-tcltk-libs=/sw/lib/ --with-readline-includes=/sw/include/ --with-
freetype-includes=/usr/local/include/ --with-freetype-libs=/usr/local/lib/ --with-jpeg-libs=/
sw/lib/ --with-jpeg-includes=/sw/include/ --with-gd-includes=/sw/include/ --with-tcltk-
includes=/sw/include/ --with-fftw-includes=/sw/include/

The version of Tcl/Tk I use is 8.4.1, from fink (http://fink.sourceforge.net).

I hope my bugreport is helpful and nonredundant.

regards

Magnus Rohde

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

Subject: Compilation problems (NVIZ)

GRASS Version: 5.0.2

When compiling the part that compiles NVIZ returns the following error:

/grass5.0.2/src/CMD/gmake5.0 /grass5.0.2/src.contrib/GMSL/NVIZ2.2/src
#################################################################
/grass5.0.2/src.contrib/GMSL/NVIZ2.2/src
  make -f OBJ.powerpc-apple-darwin6.6/make.rules

gcc -I/grass5.0.2/src/include -g -O2 -D__unix -I/usr/X11R6/include -I/usr/local/include/ -I/
usr/local/include/ -I/grass5.0.2/src/libes/ogsf -D_NO_PROTO -D__STDC__ -I/usr/local/
pgsql/include/ -c nvizAppInit.c -o OBJ.powerpc-apple-darwin6.6/nvizAppInit.o
In file included from nvizAppInit.c:9:
interface.h:257: conflicting types for `Tk_SetAppName'
/usr/local/include//tkDecls.h:573: previous declaration of `Tk_SetAppName'

The version of Tcl/Tk I use is 8.4.1, from fink (http://fink.sourceforge.net).

This is a known problem; 5.0.2 doesn't work with Tcl/Tk 8.4.x. The fix
is:

--- src.contrib/GMSL/NVIZ2.2/src/interface.h 2000/02/06 15:00:41 1.2
+++ src.contrib/GMSL/NVIZ2.2/src/interface.h 2002/10/11 12:43:35 1.3
@@ -254,7 +254,11 @@
/* tkBind.c */
int TkCopyAndGlobalEval(Tcl_Interp *, char *);
/* tkSend.c */
-char *Tk_SetAppName(Tk_Window, char *);
+#if TK_MAJOR_VERSION==8 && TK_MINOR_VERSION==4
+ CONST char *Tk_SetAppName(Tk_Window, CONST char *);
+#else
+ char *Tk_SetAppName(Tk_Window, char *);
+#endif
int Tk_SendCmd(ClientData, Tcl_Interp *, int, char **);
int TkGetInterpNames(Tcl_Interp *, Tk_Window);
/* tkSend_old.c */

--
Glynn Clements <glynn.clements@virgin.net>