I am trying to install tcl and tk on my linux server.I don't have the root password,So I am installing them in my home directory.I am using below method for installing it manually.

cd ~/tcl8.5.11/unix
./configure --prefix=/home/cnel711 --exec-prefix=/home/cnel711
make install

cd ~/tk8.5.11/unix
./configure --prefix=/home/cnel711 --exec-prefix=/home/cnel711 --with-tcl=/home/cnel711/tcl8.5.11/unix
make install

I was able to install tcl without any problem ,but I am facing problem while installing tk. configure for tk worked fine ,I am facing problem while using make.I am getting this error.

X11/Xlib.h: No such file or directory

I found out this file was missing on the server.So,I downloaded libX11-devel from here.Again,I installed it in my home directory.Then I exported the path to the header files and when I use which command to find Xlib.h,it locates ths file.

>which Xlib.h

Now, when I try to install tk again configure works fine as usual but I get the same error again while using make X11/Xlib.h: No such file or directory.

Please help me out,what possibly is going wrong here ?

2 Answers 2


The compiler is looking in standard locations for the header file: it doesn't know that you've put it in your home directory.

Try this, which sets a compiler option to point to the right place:

cd ~/tcl8.5.11/unix
CFLAGS="-I$HOME/include" ./configure --prefix=/home/cnel711 --exec-prefix=/home/cnel711
make install

More or less the same answer as Flup ;)

export CFLAGS="-I$HOME/include"

If you end up needing to link libraries in your home directory:

export CFLAGS="-I$HOME/include -L$HOME/lib"

However, if you do that you'll also need:


when you run the executable you're making.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .