[GRASS-dev] Unable to locate Tcl library

Glynn Clements glynn at gclements.plus.com
Wed Mar 17 06:03:40 EDT 2010


Jan Tosovsky wrote:

> the last month everything was Ok when I was building Grass from sources
> (according to [1]) on my Win7 64bit. Now the build fails in a configuring
> phase and an error message "Unable to locate Tcl library." appears. To tell
> the truth, I cannot confirm if the final build was Tcl ready as I use
> wxPython GUI by default.
> 
> I've found several Tcl libraries on my PC (version 8.5.2) so it is weird.
> Was there any refactoring in the meantime? Is it any kind of regression or
> am I missing something?
> 
> Here is the snippet of a console output:

> checking Tcl version... unknown (cross-compiling)
> checking Tk version... unknown (cross-compiling)

Are you actually cross-compiling?

configure decides if you're cross-compiling by compiling and executing
the program:

	#include "confdefs.h"
	main(){return(0);}

If it fails to compile, you get "C compiler cannot create executables". 
If it compiles but cannot be executed, configure assumes that you're
cross-compiling.

> checking for location of Tcl/Tk library... 
> checking for Tcl_Init in -ltcl... no
> checking for Tcl_Init in -ltcl... no
> checking for Tcl_Init in -ltclUNKNOWN... no
> checking for Tcl_Init in -ltclUNKNOWN... no
> checking for Tcl_Init in -ltclUNKNOWN... no
> checking for Tcl_Init in -ltclUNKNOWN... no
> configure: error: *** Unable to locate Tcl library.

The configure script checks for the Tcl/Tk version by compiling and
executing a test program which does:

	FILE *fp = fopen("conftestdata","w");
	fputs(TCL_VERSION, fp);

If you're cross-compiling, it can't run the executables which the
compiler generates, so it can't detect the version. If the library name
contains the version number (e.g. libtcl85.a), you lose. You can get
around this by making a copy of the library with the correct name.

However, I'm guessing that you're not actually cross-compiling, and the
problem is that configure thinks that you are.

Look at the top of the config.log file; the first few lines should look
something like:

	This file contains any messages produced by compilers while
	running configure, to aid debugging if configure makes a mistake.
	
	configure:754: checking host system type
	configure:777: checking for gcc
	configure:881: checking whether the C compiler (gcc -g -O2) works
	configure:897: gcc -o conftest -g -O2 conftest.c  1>&5
	configure:894: warning: return type defaults to 'int'
	configure:923: checking whether the C compiler (gcc -g -O2) is a cross-compiler
	configure:928: checking whether we are using GNU C

If there are any errors there, please post the beginning of the file
(everything up to "checking whether we are using GNU C").

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


More information about the grass-dev mailing list