Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Config.h - No such file or directory

Tags:

c

The file 'safe-read.c' include the lib 'config.h', where is placed this file?

I've found many files with this name in the libs, but I don't know what the right one.

UPDATE

I've my file with:

...
#include <safe-read.h>
#include <safe-read.c>
...

in the file safe-read.c there's this include block

#include <config.h> //line 19

/* Specification.  */
#ifdef SAFE_WRITE
# include "safe-write.h"
#else
# include "safe-read.h"
#endif

/* Get ssize_t.  */
#include <sys/types.h>
#include <unistd.h>

#include <errno.h>

#ifdef EINTR
# define IS_EINTR(x) ((x) == EINTR)
#else
# define IS_EINTR(x) 0
#endif

#include <limits.h>

#ifdef SAFE_WRITE
# define safe_rw safe_write
# define rw write
#else
# define safe_rw safe_read
# define rw read
# undef const
# define const /* empty */
#endif

When I compile my file I've the following error:

file: X/Y/gnulib/lib/safe-read.c line: 19 message: fatal error: config.h: No such file or directory

like image 898
Figus Avatar asked Feb 04 '12 03:02

Figus


2 Answers

You’re probably missing the libconfig-dev package from your system. Simply run the following command and it’ll fix it:

sudo apt-get install libconfig-dev

like image 85
Muhammad Hassan Avatar answered Oct 24 '22 00:10

Muhammad Hassan


config.h is normally generated by the ./configure script to reflect the target system's characteristics. In your case, it's tied into the whole gnulib "let's replace all the system's library functions with out own hacks" mess, so a lot of what's in a gnulib project config.h is stuff that gnulib's portion of configure generated.

like image 39
R.. GitHub STOP HELPING ICE Avatar answered Oct 24 '22 02:10

R.. GitHub STOP HELPING ICE