From p.dalgaard at biostat.ku.dk  Tue Oct 21 08:49:39 2003
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Tue Oct 21 08:45:27 2003
Subject: [Rd] Problem R-1.8.0 library tcltk on Tcl-8.0.5 (PR#4699)
In-Reply-To: <200310210429.h9L4Tq0P021121@pubhealth.ku.dk>
References: <200310210429.h9L4Tq0P021121@pubhealth.ku.dk>
Message-ID: <x28ynfdr0c.fsf@biostat.ku.dk>

nakama@ki.rim.or.jp writes:

> Full_Name: Eiji Nakama
> Version: R-1.8.0
> OS: linux(VineLinux)
> Submission from: (NULL) (219.117.236.13)
> 
> 
> I build by Tcl8.0.5 and R-1.8.0.
> 
> > library(tcltk)
> Error in dyn.load(x, as.logical(local), as.logical(now)) : 
> 	unable to load shared library "/usr/lib/R/library/tcltk/libs/tcltk.so":
>   /usr/lib/R/library/tcltk/libs/tcltk.so: undefined symbol:
> RTcl_ActivateConsoleError in runHook(".onLoad", env, package.lib, package) : 
> 	.onLoad failed
> Error in library(tcltk) : package/namespace load failed
> 
> R-1.8.0/src/library/tcltk/src/init.c
>      32 #ifndef TCL80
>      33     {"RTcl_ActivateConsole", (DL_FUNC) &RTcl_ActivateConsole, 0},
>      34 #endif
> 
> TCL80 is not defined anywhere.
> It is defined only as tcltk.c.

Yes. The workaround should be obvious. Or upgrade tcl/tk -- 8.0.x is
pretty ancient by now.

The proper fix is probably to move

#include <tcl.h>
#include <tk.h>

#if (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION==0)
#define TCL80
#endif

from tcltk.c into tcltk.h.

(Argh. The test builds of 1.8.0 were actually against tcl8.0, but
apparently our testing procedures skip any attempt to load the dynlib.
Automated tests of tcl/tk are difficult because Tk will protest if
there is no X display.)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] Problem R-1.8.0 library tcltk on Tcl-8.0.5 (PR#4699)
Peter Dalgaard