Tuesday 19 March 2019

fatal error: libconfig.h: No such file or directory

gcc -c main.c
main.c:12:23: fatal error: libconfig.h: No such file or directory
 #include "libconfig.h"
                       ^
compilation terminated.







Solution: fire this command on terminal

 [root@localhost zoocurator]# `gcc -print-prog-name=cc1` -v
 

ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include
 /usr/local/include
 /usr/include
End of search list.


/////////////now manually check the gcc include folders listed above for libconfig.h/////////////////////

[root@localhost include]# ls
aio.h        err.h           inttypes.h  neteconet   rpc            tar.h
aliases.h    errno.h         langinfo.h  netinet     rpcsvc         termio.h
alloca.h     error.h         lastlog.h   netipx      sched.h        termios.h



if it is not available then


for centos :
# yum install libconfig 
# yum install libconfig-devel

[root@localhost include]# yum install libconfig-devel

Now check the folder again for    libconfig.h


 Ref: http://lampwww.epfl.ch/~fsalvi/docs/gcc/www.network-theory.co.uk/docs/gccintro/gccintro_20.html 





 

No comments:

Post a Comment