Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu 16.04: fatal error: X11/Xlib.h: No such file or directory

I am trying to install Rgtk2 (dependency for rattle). I am using R thru Anaconda. I am getting the following error.

In file included from Rgtk.c:7:0:  
/usr/include/gtk-2.0/gdk/gdkx.h:32:10: fatal error: X11/Xlib.h: No such file or directory  
 #include <X11/Xlib.h>   
          ^~~~~~~~~~~~ 

I tried the following workarounds as found in StackOverflow and other blogs.

  1. Installed libx11-dev, mesa-common-dev, libglu1-mesa-dev, libxrandr-dev, libxi-dev

  2. Tried installing RGtk2_2.20.31 from source.

Every time I am getting the same error.

like image 515
Anup Avatar asked Oct 23 '25 22:10

Anup


1 Answers

anaconda has its own environment, which by default usually lacks X11 headers(e.g libx11-dev, or whatever you call it). Try "conda install -c conda-forge xorg-libx11" . It worked for me when a certain R-package threw an error "X11/Xlib.h : No such file or directory".

like image 79
Y.Luo Avatar answered Oct 25 '25 11:10

Y.Luo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!