sto cercando di utilizzare la libreria BFD, e così ho installato il pacchetto binutils-dev
e hanno incluso:binutils/bfd.h vuole config.h ora?
#include <bfd.h>
e sto chiamando bfd_openr
e bfd_close
e così via dal mio codice.
pacchetti Recentemente ho aggiornato e ora ho un errore da qui:
bfd.h:
/* PR 14072: Ensure that config.h is included first. */
#if !defined PACKAGE && !defined PACKAGE_VERSION
#error config.h must be included before this header
#endif
... che devo includere config.h
- ma non sto usando autoconf.
sono io compreso il file di intestazione sbagliata? Come dovresti usare binutils-dev?
Ecco un programma demo:
#include <stdio.h>
#include <bfd.h>
int main()
{
bfd_init();
bfd* file = bfd_openr("a.out", 0);
if (!file)
return -1;
if (bfd_check_format(file, bfd_object))
printf("object file\n");
else
printf("not object file\n");
bfd_close(file);
return 0;
}
tenta di compilare ed eseguire il seguente:
$ sudo apt-get install binutils-dev
$ gcc test.c
In file included from test.c:3:0:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
correlati: http://sourceware.org/bugzilla/show_bug.cgi?id= 14243 – cnicutar