Aug 23, 2013

Compiling problem: XXX.c:##:##: fatal error: XXX/XXX/XXX.h: No such file or directory



When you download a source package and try to build the program from the source code, chances are that the README file can not list all prerequisite for you. As a result, for example, you will see something like this:

glut_input.c:22:35: fatal error: X11/extensions/XInput.h: No such file or directory

On a Ubuntu/Debian system, you can use apt-file to solve this problem. For example, you can type:
apt-file search X11/extensions/XInput.h
Then, it will show you
libxi-dev: /usr/include/X11/extensions/XInput.h
Good. Now you can type
apt-get install libxi-dev
to install the missing package and then keep building your program.

On a Redhat/CentOS system, you can use
yum whatprovides "X11/extensions/XInput.h"
to locate the missing package. Then you can move on.

Picture today:
Deep Creek lake. MD. [courtesy of my dear wife - Claire Huang]

No comments:

Post a Comment