[SOLVED] What to do when you see a missing include file error like "fatal error: something.h: No such file or directory" when you build/compile/install something from source on Ubuntu Linux Server/Desktop
These are some common errors that you might face when you try to build/compile/install something from source on Ubuntu Linux Server/Desktop:
fatal error: openssl/ssl.h: No such file or directory
fatal error: zlib.h: No such file or directory
fatal error: png.h: No such file or directory
fatal error: curl/curl.h: No such file or directory
fatal error: expat.h: No such file or directory
This would be because of some missing library packages which contain these include files.
The ideal way to deal with these would be:
1. Go to http://packages.ubuntu.com/.
2. Under the main section 'Search', look for the sub-section labelled 'Search the contents of packages', and enter the following:
a) In the textbox against 'Keyword', enter the name of the file to be searched for. (eg.: "ssl.h" or "zlib.h" or "png.h" or "curl.h" or "expat.h").
b) Under the 'Display' radio buttons, choose the option labelled "packages that contain files named like this".
c) Select your Distribution, Architecture.
d) Click the Search button.
3. From the Search Results that show up, make a guess (it's usually one of the packages that have the name starting with "lib..." - eg.: when searching for 'ssl.h', I would choose 'libssl-dev').
4. Now install that package using:
sudo apt-get install packagename
That should do it.
Now try doing the build/compile/install again.
Let me know (using the Comments section below) if you face any further difficulty.
Cheers,
Anto
- 54207 reads
Comments
Gandhi (not verified)
Fri, 01/10/2014 - 11:23
Permalink
Clearly Explained
Nice explanation.. :)
Janos (not verified)
Mon, 01/13/2014 - 21:46
Permalink
Thanks! Nice and pragmatic
Thanks! Nice and pragmatic approach :-).
DAWN T CHERIAN (not verified)
Fri, 12/12/2014 - 11:09
Permalink
It worked. Thanks. :)
It worked. Thanks. :)
siddharth (not verified)
Mon, 12/29/2014 - 13:13
Permalink
fatal error: png.h: No such file or directory
Hey,
i have followed the above mentioned steps but haven't got any benefit ...i am getting again the same error.
In file included from /home/ravi/adt-bundle-linux-x86_64-20131030_Full_ADT_Working_tool/cocos2d-x-cocos2d-2.1rc0-x-2.1.2/NewTestProject/proj.android/../../cocos2dx/platform/android/CCImage.cpp:28:0:
/home/ravi/adt-bundle-linux-x86_64-20131030_Full_ADT_Working_tool/cocos2d-x-cocos2d-2.1rc0-x-2.1.2/NewTestProject/proj.android/../../cocos2dx/platform/CCImageCommon_cpp.h:33:17: fatal error: png.h: No such file or directory
compilation terminated.
Ravi (not verified)
Fri, 01/30/2015 - 15:00
Permalink
What if I am cross compiling ?
I am cross compiling wpa_supplicant for raspberry pi in Ubuntu. So the libraries I install in ubuntu won't be in my arm board. Currently I am getting the error "ssh.h not found".
George Solymosi (not verified)
Thu, 06/11/2015 - 01:37
Permalink
Your help was unpayable Anto.
Your help was unpayable Anto. Saved me a lot of time and work!
Thank you!
George
Add new comment