3

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.

M--
  • 25,431
  • 8
  • 61
  • 93
Anup
  • 63
  • 1
  • 6
  • libx11-dev should cut it. Is there `/usr/include/X11`? `/usr/include/X11/Xlib.h`? If not try this command `find /usr -name Xlib.h`, is anything there? – n. m. could be an AI Dec 15 '17 at 07:08
  • Thank you very much for the reply. I got it running. The issue was with Anaconda environment. I removed the application from Anaconda and installed it independently. I still don't know why it was not working within Anaconda. – Anup Dec 15 '17 at 10:20

1 Answers1

4

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".

Y.Luo
  • 76
  • 4