# Tcltklib does not get compiled

**URL:** <https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311>\
**Category:** ruby-talk\
**Created:** [10 June 2003 12:04 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311 "2003-06-10T12:04:32Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Fletcher](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@John\_Fletcher](https://rubytalk.org/u/John_Fletcher)\
**Post date:** [10 June 2003 12:04 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/1 "2003-06-10T12:04:32Z")

</div>

I have installed ruby 1.6.7 on two computers using Red Hat 8.0 Linux.  
This installs tcl in usr rather than usr/local. I want to use the Tk  
extension.

On one computer the make for Ruby does not compile tcltklib. It seems to  
just pass over it. The log from make goes

compiling tcltklib  
compiling tk

and it then compiles tkutil.c and makes [tkutil.so](http://tkutil.so) but does not touch  
tcltklib.

On the other installation it does make [tcltklib.so](http://tcltklib.so). The only difference  
I can identify is that the second computer had Red Hat 8 as an upgrade  
from RH 7.2, and the first computer has it as a new installation.

Is there anything I can do to force make to build tcltklib?

Thank you

John Fletcher

---

<div class="post-metadata">

**Author:** ![John\_Fletcher](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@John\_Fletcher](https://rubytalk.org/u/John_Fletcher)\
**Post date:** [10 June 2003 12:24 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/2 "2003-06-10T12:24:48Z")

</div>

John Fletcher wrote:

> I have installed ruby 1.6.7 on two computers using Red Hat 8.0 Linux.  
> This installs tcl in usr rather than usr/local. I want to use the Tk  
> extension.
> 
> On one computer the make for Ruby does not compile tcltklib. It seems to  
> just pass over it. The log from make goes
> 
> compiling tcltklib  
> compiling tk
> 
> and it then compiles tkutil.c and makes tkutil.so but does not touch  
> tcltklib.
> 
> On the other installation it does make tcltklib.so. The only difference  
> I can identify is that the second computer had Red Hat 8 as an upgrade  
> from RH 7.2, and the first computer has it as a new installation.
> 
> Is there anything I can do to force make to build tcltklib?
> 
> Thank you
> 
> John Fletcher

I also have tried building Ruby 1.6.8 with the same result.

Looking in the archive I can find this question asked a number of times on  
different systems but no answer.

John

---

<div class="post-metadata">

**Author:** ![ts1](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@ts1](https://rubytalk.org/u/ts1)\
**Post date:** [10 June 2003 12:26 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/3 "2003-06-10T12:26:25Z")

</div>

> Is there anything I can do to force make to build tcltklib?

When you run configure, you can give it some options to say where is  
installed tcl, tk, ...

See [ruby-talk:58826]

[http://www.ruby-talk.org/58826](http://www.ruby-talk.org/58826)

Guy Decoux

---

<div class="post-metadata">

**Author:** ![John\_Fletcher](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@John\_Fletcher](https://rubytalk.org/u/John_Fletcher)\
**Post date:** [11 June 2003 09:10 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/4 "2003-06-11T09:10:38Z")

</div>

John Fletcher wrote:

> I have installed ruby 1.6.7 on two computers using Red Hat 8.0 Linux.  
> This installs tcl in usr rather than usr/local. I want to use the Tk  
> extension.
> 
> On one computer the make for Ruby does not compile tcltklib. It seems to  
> just pass over it. The log from make goes
> 
> compiling tcltklib  
> compiling tk
> 
> and it then compiles tkutil.c and makes tkutil.so but does not touch  
> tcltklib.
> 
> On the other installation it does make tcltklib.so. The only difference  
> I can identify is that the second computer had Red Hat 8 as an upgrade  
> from RH 7.2, and the first computer has it as a new installation.
> 
> Is there anything I can do to force make to build tcltklib?
> 
> Thank you
> 
> John Fletcher

The solution to this problem is quite simple. Ensure that all the needed  
components are installed. These are tcl and tk and also the X11 development  
tools. I am posting this so that it can be found by other people with the  
same query. I noticed in the archive a number of similar postings on a  
variety of different Unix systems.

John

---

<div class="post-metadata">

**Author:** ![John\_Fletcher](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@John\_Fletcher](https://rubytalk.org/u/John_Fletcher)\
**Post date:** [10 June 2003 12:45 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/5 "2003-06-10T12:45:01Z")

</div>

ts wrote:

> > Is there anything I can do to force make to build tcltklib?
> 
> When you run configure, you can give it some options to say where is  
> installed tcl, tk, …
> 
> See [ruby-talk:58826]
> 
> [http://www.ruby-talk.org/58826](http://www.ruby-talk.org/58826)
> 
> Guy Decoux

I have tried specifying

–with-tcl-include=/usr/include

etc and nothing seems to make a difference.

John

---

<div class="post-metadata">

**Author:** ![Ruben](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Ruben](https://rubytalk.org/u/Ruben)\
**Post date:** [10 June 2003 12:48 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/6 "2003-06-10T12:48:49Z")

</div>

Shouldn’t that be /usr/include/tcl8.3 ?

Ruben

> **···**
>
> On Tue, 10 Jun 2003, John Fletcher wrote:
> 
> > I have tried specifying
> > 
> > –with-tcl-include=/usr/include
> > 
> > etc and nothing seems to make a difference.
> > 
> > John

---

<div class="post-metadata">

**Author:** ![ts1](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@ts1](https://rubytalk.org/u/ts1)\
**Post date:** [10 June 2003 12:50 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/7 "2003-06-10T12:50:38Z")

</div>

> I have tried specifying  
> --with-tcl-include=/usr/include  
> etc and nothing seems to make a difference.

Well, try to cd to ext/tcltklib and run ruby extconf.rb to see what it say,  
for example

svg% cd ext/tcltklib  
svg%

svg% ruby extconf.rb  
checking for t\_open() in -lnsl... no  
checking for socket() in -lsocket... no  
checking for dlopen() in -ldl... yes  
checking for log() in -lm... yes  
checking for tcl.h... yes  
checking for tk.h... yes  
checking for XOpenDisplay() in -lX11... yes  
checking for Tcl\_FindExecutable() in -ltcl... yes  
checking for Tk\_Init() in -ltk... yes  
creating Makefile  
svg%

be sure to have all header and libraries installed

Guy Decoux

---

<div class="post-metadata">

**Author:** ![John\_Fletcher](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@John\_Fletcher](https://rubytalk.org/u/John_Fletcher)\
**Post date:** [10 June 2003 13:25 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/8 "2003-06-10T13:25:15Z")

</div>

Ruben Vandeginste wrote:

> **···**
>
> > On Tue, 10 Jun 2003, John Fletcher wrote:
> > 
> > > I have tried specifying
> > > 
> > > –with-tcl-include=/usr/include
> > > 
> > > etc and nothing seems to make a difference.
> > > 
> > > John
> > 
> > Shouldn’t that be /usr/include/tcl8.3 ?
> > 
> > Ruben
> 
> Thanks. tk.h and tcl.h are in /usr/include. The libs are in  
> /usr/lib/tcl8.3 /usr/lib/tk8.3
> 
> It still doesn’t work.
> 
> John

---

<div class="post-metadata">

**Author:** ![John\_Fletcher](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@John\_Fletcher](https://rubytalk.org/u/John_Fletcher)\
**Post date:** [10 June 2003 13:25 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/9 "2003-06-10T13:25:17Z")

</div>

ts wrote:

> > I have tried specifying  
> > –with-tcl-include=/usr/include  
> > etc and nothing seems to make a difference.
> 
> Well, try to cd to ext/tcltklib and run ruby extconf.rb to see what it say,  
> for example
> 
> svg% cd ext/tcltklib  
> svg%
> 
> svg% ruby extconf.rb  
> checking for t\_open() in -lnsl… no  
> checking for socket() in -lsocket… no  
> checking for dlopen() in -ldl… yes  
> checking for log() in -lm… yes  
> checking for tcl.h… yes  
> checking for tk.h… yes  
> checking for XOpenDisplay() in -lX11… yes  
> checking for Tcl\_FindExecutable() in -ltcl… yes  
> checking for Tk\_Init() in -ltk… yes  
> creating Makefile  
> svg%
> 
> be sure to have all header and libraries installed
> 
> Guy Decoux

Thanks for this.

I can now run the script above.

I still get a no for tk.h although I have told it where it is (usr/include) and  
it finds tcl.h in the same location.

The readme file does not describe any of these options.

What should --with-tk-dir point to if I already have --with-tk-include and  
–with-tk-lib?

Thanks

John

---

<div class="post-metadata">

**Author:** ![Mark\_Wilson](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@Mark\_Wilson](https://rubytalk.org/u/Mark_Wilson)\
**Post date:** [12 June 2003 02:27 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/10 "2003-06-12T02:27:39Z")

</div>

[snip]svg% ruby extconf.rb

> checking for t\_open() in -lnsl… no  
> checking for socket() in -lsocket… no  
> checking for dlopen() in -ldl… yes  
> checking for log() in -lm… yes  
> checking for tcl.h… yes  
> checking for tk.h… yes  
> checking for XOpenDisplay() in -lX11… yes  
> checking for Tcl\_FindExecutable() in -ltcl… yes  
> checking for Tk\_Init() in -ltk… yes  
> creating Makefile

> [snip]

I am also having trouble getting tcltklib compiled. When I manually  
run ‘ruby extconf.rb’ I get the following:

ruby extconf.rb  
checking for t\_open() in -lnsl… no  
checking for socket() in -lsocket… no  
checking for dlopen() in -ldl… yes  
checking for log() in -lm… yes  
checking for tcl.h… yes  
checking for tk.h… yes  
checking for XOpenDisplay() in -lX11… yes  
checking for Tcl\_FindExecutable() in -ltcl… yes

I don’t get the last two lines cited above.

Which means, I guess, that Tk-Init() in -ltk is not found (although  
this check fails silently). Does anyone have any suggestions?

Regards,

Mark

> **···**
>
> On Tuesday, June 10, 2003, at 08:50 AM, ts wrote:

---

<div class="post-metadata">

**Author:** ![ts1](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@ts1](https://rubytalk.org/u/ts1)\
**Post date:** [10 June 2003 13:29 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/11 "2003-06-10T13:29:21Z")

</div>

> I still get a no for tk.h although I have told it where it is (usr/include) and  
> it finds tcl.h in the same location.

Well, it is trying to compile this program (gcc -E)

/\* begin \*/  
#include \<tk.h\>  
/\* end \*/

If it say 'no', this means that some header (probably X11) are not found

Guy Decoux

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [10 June 2003 13:43 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/12 "2003-06-10T13:43:31Z")

</div>

Hi,

> **···**
>
> From: John Fletcher [J.P.Fletcher@aston.ac.uk](mailto:J.P.Fletcher@aston.ac.uk)  
> Subject: Re: tcltklib does not get compiled.  
> Date: Tue, 10 Jun 2003 22:25:17 +0900  
> Message-ID: [3EE5D722.4341EA8B@aston.ac.uk](mailto:3EE5D722.4341EA8B@aston.ac.uk)
> 
> > I can now run the script above.  
> > I still get a no for tk.h although I have told it where it is (usr/include)  
> > and it finds tcl.h in the same location.  
> > The readme file does not describe any of these options.  
> > What should --with-tk-dir point to if I already have --with-tk-include and  
> > –with-tk-lib?
> 
> ## Try to give options at running extconf.rb and show us mkmf.log. (e.g. ruby extconf.rb --with-tcllib=tcl8.3 --with-tklib=tk8.3 … ) The log message maybe useful to avoid the trouble. On [ruby-list:37767], it was reported that configure script fails to pass the given options to extconf.rb for tcltklib. I don’t know the reason. I don’t check scripts yet.
> 
> ```
> Hidetoshi Nagai (nagai@ai.kyutech.ac.jp)
> 
> ```

---

<div class="post-metadata">

**Author:** ![John\_Fletcher](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@John\_Fletcher](https://rubytalk.org/u/John_Fletcher)\
**Post date:** [10 June 2003 13:45 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/13 "2003-06-10T13:45:31Z")

</div>

ts wrote:

> > I still get a no for tk.h although I have told it where it is (usr/include) and  
> > it finds tcl.h in the same location.
> 
> Well, it is trying to compile this program (gcc -E)
> 
> /\* begin _/  
> #include \<tk.h\>  
> /_ end \*/
> 
> If it say ‘no’, this means that some header (probably X11) are not found
> 
> Guy Decoux

I think that is the problem. I cannot find the X11 header. It will be a Red Hat  
install option which somehow got missed - develop for X windows or something like  
that.

Thanks for all your help.

John

---

<div class="post-metadata">

**Author:** ![John\_Fletcher](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@John\_Fletcher](https://rubytalk.org/u/John_Fletcher)\
**Post date:** [10 June 2003 14:05 UTC](https://rubytalk.org/t/tcltklib-does-not-get-compiled/6311/14 "2003-06-10T14:05:46Z")

</div>

John Fletcher wrote:

> ts wrote:

> > > I still get a no for tk.h although I have told it where it is (usr/include) and  
> > > it finds tcl.h in the same location.
> > 
> > Well, it is trying to compile this program (gcc -E)
> > 
> > /\* begin _/  
> > #include \<tk.h\>  
> > /_ end \*/
> > 
> > If it say ‘no’, this means that some header (probably X11) are not found
> > 
> > Guy Decoux
> 
> I think that is the problem. I cannot find the X11 header. It will be a Red Hat  
> install option which somehow got missed - develop for X windows or something like  
> that.
> 
> Thanks for all your help.
> 
> John

Yes. They should be in /usr/X11R6/include/X11 and they are not there. And the install  
disks are at home. Ah well.

Thanks again.

John
