[GRASSLIST:2259] Re: NVIZ on Cygwin

Glynn Clements glynn.clements at virgin.net
Sat Jan 17 07:17:52 EST 2004


Richard Greenwood wrote:

> I am trying to get NVIZ (from Grass 5.0.3 source) compiled and working 
> on Cygwin.  I have a new, clean, minimal Cygwin install and built Grass. 
> It appears to run, as does tcltkgrass, but nviz generates the error [1] 
> below. Inspecting my config.log, I see a couple suspicious errors, [2] 
> and [3] below.
> 
> [2] says "ld: cannot find -ltk" and neither can I. Do I need to link tk 
> to something? And if so, what?

No. If you look at what follows that section in config.log, you will
note that configure first tries "-ltk"; if that fails, it tries e.g. 
-ltk8.3, then finally -ltk83 (in the last two cases, the version is
deduced from the tk.h header file).

Errors messages in config.log are normal. The most basic configure
checks either succeed or fail. More complex checks (e.g. choosing one
of a list of likely possibilities) are constructed by performing a
series of basic checks until one succeeds.

> [3] is a list of 427 undefined references. Am I missing a library, or a 
> link, or something in my path?

> configure:8678: gcc -o conftest -O2    -I/usr/include/ncurses  -s 
> -L/usr/local/lib -L/usr/X11R6/lib conftest.c -ltk8.3  -ltcl8.3    1>&5
> /usr/local/lib/libtk8.3.a(tkWindow.o)(.text+0x138c):tkWindow.c: 
> undefined reference to `_XDestroyWindow'
> /usr/local/lib/libtk8.3.a(tkWindow.o)(.text+0x1404):tkWindow.c: 
> undefined reference to `_XDestroyIC'
> ##### another 425 lines of libtk8.3. undefined references follow

The symbols are part of Xlib (/usr/X11R6/lib/libX11.a).

The configure checks for the Tk library try each of the aforementioned
variants (-ltk, -ltk8.3, -ltk83) twice; first without the X libraries
then, if that fails, with them.

Again, the error messages from failed attempts don't matter, so long
as it ultimately finds a combination which succeeds. If all of the
combinations fail, you will get an error message along the lines of:

	*** Unable to locate Tk library.

and the configure script will abort at that point.

> There are two shell scripts in /usr/local/lib 'tclConfig.sh' and 
> 'tkConfig.sh' which define numerous shell variables.  Is it possible 
> that these relate to my problem? Do I need to run these prior to 
> configure and build?

No. GRASS' build system doesn't use those files.

> === [1] ====
> GRASS:~ > nviz ned_patch
> child killed: segmentation violation
>     while executing

[snip]

Unfortunately, almost everything which could possibly go wrong with
building NVIZ results in exactly this error message (including the
stuff which I've snipped).

The only way to track such problems down is to use a debugger (e.g. 
gdb). If you can try the following, it may provide useful information:

	GRASS:~ > eval `g.gisenv`
	GRASS:~ > gdb /home/Rich/grass/grass-5.0.3/dist.i686-pc-cygwin/etc/nviz2.2/NVWISH2.2
	> run -f /home/Rich/grass/grass-5.0.3/dist.i686-pc-cygwin/etc/nviz2.2/scripts/nviz2.2_script ned_patch -name NVIZ
	[... segmentation fault ...]
	> where

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




More information about the grass-user mailing list