는 내가 BFD 라이브러리를 사용하려고 해요, 그래서 나는 패키지 binutils-dev
을 설치 한 및 포함했다 :binutils/bfd.h는 지금 config.h를 원하십니까?
#include <bfd.h>
을 내 코드에서 등등 bfd_openr
및 bfd_close
과를 호출하고 있습니다.
최근에 업그레이드 한 패키지와 지금 여기에서 오류가 발생합니다 :
bfd.h :
내가config.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
... -하지만 autoconf를 사용하지 않는입니다.
잘못된 헤더 파일을 포함하고 있습니까? binutils-dev는 어떻게 사용합니까?
#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;
}
시도 컴파일하고 다음과 같이 실행 :
$ 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
관련 ...
stdint.h
및inttypes.h
확인 처리해야 할 것 14243 – cnicutar