0

There are lots of post here but none of them have helped me.

I have successfully installed libx11-dev from apt-get and still netbeans complaining that it cannot find include file <X11/Xlib.h>.

Also I have tried find xlib.h and there is no Xlib.h file nor X11 folder on my hard disk.

find / X11 
find / Xlib.h

Is there somenthing I should be looking at to fix it? I am using ubuntu 12 and it is a c/c++ project.

Guilherme Longo
  • 2,278
  • 7
  • 44
  • 64
  • Please run this command and tell us what it prints: `dpkg -L libx11-dev; COLUMNS=500 dpkg -l libx*-dev | awk '{print $1, $2}'` – zwol Feb 09 '13 at 03:53
  • Found the problem. I found the librarie in /usr/include/X11. After including this path to the include directories in netbeans it fixed the problem. I believed that all files including those inside of sub folders of /usr/include where automatically found. – Guilherme Longo Feb 09 '13 at 03:56
  • Aha. Meanwhile I've confirmed that `libx11-dev` was the correct thing to install, and I've written you an answer explaining why your `find` commands didn't work. – zwol Feb 09 '13 at 04:02

1 Answers1

2

I don't know anything about netbeans, but: you can find out what's in a package installed on your system with the command

dpkg -L <name of package>

When I do this on an Ubuntu system I have access too, it indicates that libx11-dev is supposed to include the file /usr/include/X11/Xlib.h. However, this does not tell you if the file actually exists. You need something like the find commands you were trying for that.

Now, your find commands didn't do anything because find has a command line syntax that's different from everything else. This is how to do what you were trying to do with find:

find / -name Xlib.h -print
find / -name X11 -print

(On recent systems with GNU userland (i.e. all Linux and some others), the trailing -print is not necessary, but on older systems and possibly also those that retain more of a BSD heritage, it is. I learned my shell back in the bad old days of SunOS 4 and I still have those habits.)

zwol
  • 135,547
  • 38
  • 252
  • 361