X11/extensions/Xcomposite.h: No such file or directory

11,926

Solution 1

Whenever a compile fails with a missing file simply leverage the infrastructure to search for the missing ubuntu package

apt-file search   some_missing_file_goes_here   #  cmd 1    
apt-file search   X11/extensions/Xcomposite.h   #  cmd 1

which returns with

libxcomposite-dev: /usr/include/X11/extensions/Xcomposite.h

so solution is to install that missing package

sudo apt-get install libxcomposite-dev              #  cmd 2

this technique works across any missing file


On a fresh OS if you issue

apt-file search   X11/extensions/Xcomposite.h  

it will fail with error

The program 'apt-file' is currently not installed. To run 'apt-file' please ask your administrator to install the package 'apt-file'

which just means you need to do a one time setup of the local search cache so just run

sudo apt-get install apt-file -y
sudo apt-file update

now re-issue the search shown above (cmd 1) then install package (cmd 2)

Solution 2

On http://packages.ubuntu.com/ you can search for packages containing a file.

For X11/extensions/Xcomposite.h that finds libxcomposite-dev

Solution 3

sudo apt-get install libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev

That should do it!

Share:
11,926

Related videos on Youtube

Wouter Schoofs
Author by

Wouter Schoofs

Updated on September 18, 2022

Comments

  • Wouter Schoofs
    Wouter Schoofs over 1 year

    I've tried to compile https://unix.stackexchange.com/a/228674 under Ubuntu.

    Unfortunately ending up with following error:

    /tmp/find-cursor$ make
    cc find-cursor.c -o find-cursor -lX11
    find-cursor.c:19:39: fatal error: X11/extensions/Xcomposite.h: No such file or directory
     #include <X11/extensions/Xcomposite.h>
                                           ^
    compilation terminated.
    make: *** [all] Error 1
    

    I've tried with following suspects:

    $ sudo apt-get install libxtst-dev libxss-dev libxtst6-dbg libxext6-dbg libxss1-dbg
    

    but still no luck in compiling. Here is snippet for your convenience:

    sudo apt-get install mercurial
    cd /tmp
    hg clone https://bitbucket.org/Carpetsmoker/find-cursor
    cd find-cursor
    make
    

    Solved:

    FTR: to compile above code I had to : sudo apt-get install libxcomposite-dev libxdamage-dev libxrender-dev and add -std=gnu99 flag to cc in Makefile

  • Joe Heyming
    Joe Heyming over 5 years
    This is a fantastic answer. I feel unblocked for future issues.