Installing xdotool from source (missing XTest and other dependencies)
If you don’t know what xdotool is then this post is not for you…
Although many distros come with a packaged xdotool it is usually pretty old version (e.g. the one that comes wiht FC15 does not have the selectwindow command!) so you will most likely want to get the source tarball and install that. Download it from here.
– 1 –
After you untar and ‘make’ you will likely get some errors due to missing dependencies and due to Makefile referring to old include locations, with the first error most likely being:
xdo.c:24:22: fatal error: X11/Xlib.h: No such file or directory
This most likely means that the X11 development lib is not installed (I said “most likely”, because even if it were – the xdotool Makefile is a bit broken as it refers to the old locations for the X11 libs. Read below how to fix that problem – for now we’ll be dealing with the possibly missing libs).
The missing lib is the X11 development lib. Depending on your distro it may be called e.g. libx11-dev (ubuntu), libX11-devel (fedora) or something similar. Use your package manager to install the lib and all dependencies that it says it needs. Make sure to install the DEVELOPMENT version of the library!
– 2 –
Now that libx11-dev is installed it’s time to fix the Makefile. Edit the Makefile and search for -L. You should see two lines that look like this:
DEFAULT_LIBS=-L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXtst -lXinerama
DEFAULT_INC=-I/usr/X11R6/include -I/usr/local/include
As you can see the lib and include paths refer to the old location for X11 libs. Fix this by prepending the correct paths :
DEFAULT_LIBS=-L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXtst -lXinerama
DEFAULT_INC=-I/usr/include/X11 -I/usr/X11R6/include -I/usr/local/include
– 3 –
Ok – now that we have the x11 lib and the paths are fixed lets ‘make’ again!
xdo.c:28:34: fatal error: X11/extensions/XTest.h: No such file or directory
Damn! We need XTEST extensions… That one is a bit trickier as it may be found in all sorts of packages depending on the distribution.
To find it on ubuntu use: apt-file search XTest.h
On Fedora you can also find the package that contains a file (see my post on RPM files).
To make your life easier here’s that package name for FC and ubuntu:
Fedora Core: libXtst-devel
ubuntu: libxtst-dev (interestingly – Synaptic on xubuntu 11.04 was unable to find this package! I had to use apt-get install libxtst-dev to install this…)
– 4 –
Make again… Another error…
xdo.c:29:37: fatal error: X11/extensions/Xinerama.h: No such file or directory
Won’t scare us, now that we know how to locate the missing file packages 😉
Install libXinerama-devel (libxinerama-dev) and you should be all set now!
– 5 –
make
make install
ldconfig
Done!
6 Responses to Installing xdotool from source (missing XTest and other dependencies)
Leave a Reply to Cao Anh Hao Cancel reply
-
Categories
- Android Development
- Bash
- C programming
- dpkg/apt-get
- drupal
- Emacs
- Git
- Java
- Linux administration
- Linux device drivers
- Linux Gaming
- Linux kernel
- Linux Networking
- Linux on Windows
- Linux printing
- Linux sound and ALSA
- Package Managers
- Programming
- RPM
- Shell and environment
- Tips and tricks
- Uncategorized
- VirtualBox
- Virtualization
- web development
- wine
- WMaker
- Wordpress Tips
- X Window System
- XFCE
-
Articles
- August 2020
- August 2019
- May 2019
- July 2017
- February 2017
- January 2017
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- April 2016
- March 2016
- December 2015
- November 2015
- September 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- February 2014
- January 2014
- November 2013
- October 2013
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
-
Meta
Cloud
audio bash boot compile C programming cups drupal emacs etc Fedora git grep how to httpd init kernel libc linux linux partition localtime login make mount mp3 mysql networking oracle package managers password phpMyAdmin programming rpm shell sql vbox version control system virtual box vm web server wordpress www xargs xfce xwin yum
thanks very much.
you are my pleasure…
Thank you very much, worked like a charm
Thanks for the helpful post.
thanks a lot
Thank you very much.
Thank you bro!