실행시 아래와 같은 오류가 발생합니다make tooldir=/usr
../../binutils-2.22/libiberty/regex.c:130:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.22/libiberty/regex.c:130:7: warning: conflicting types for built-in function 'malloc' [enabled by default]
../../binutils-2.22/libiberty/regex.c:131:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.22/libiberty/regex.c:131:7: warning: conflicting types for built-in function 'realloc' [enabled by default]
In file included from /usr/include/bits/string2.h:1296:0,
from /usr/include/string.h:633,
from ../../binutils-2.22/libiberty/regex.c:149:
/usr/include/stdlib.h:470:14: error: conflicting types for 'malloc'
../../binutils-2.22/libiberty/regex.c:130:7: note: previous declaration of 'malloc' was here
In file included from ../../binutils-2.22/libiberty/regex.c:638:0:
../../binutils-2.22/libiberty/regex.c: In function 'byte_regex_compile':
../../binutils-2.22/libiberty/regex.c:2439:7: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]
../../binutils-2.22/libiberty/regex.c:2439:33: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2500:17: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2533:36: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2640:28: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:3643:26: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:4150:5: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'byte_re_compile_fastmap':
../../binutils-2.22/libiberty/regex.c:4835:11: warning: implicit declaration of function 'abort' [-Wimplicit-function-declaration]
../../binutils-2.22/libiberty/regex.c:4835:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'byte_re_match_2_internal':
../../binutils-2.22/libiberty/regex.c:7424:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregcomp':
../../binutils-2.22/libiberty/regex.c:7978:4: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregexec':
../../binutils-2.22/libiberty/regex.c:8053:7: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregerror':
../../binutils-2.22/libiberty/regex.c:8081:5: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregfree':
../../binutils-2.22/libiberty/regex.c:8114:3: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
make[2]: *** [regex.o] Error 1
make[2]: Leaving directory `/sources/binutils-build/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory `/sources/binutils-build'
make: *** [all] Error 2
전체 출력은 다음과 같습니다.여기, 제가 사용하는 페이지는여기
누가 날 도울 수 있죠?
편집하다:
/usr/include/stdlib.h
(라인 470)
extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
binutils-2.22/libiberty/regex.c
(130행)
char *malloc ();
답변1
문제는 코드를 컴파일할 때 STDC_HEADERS가 정의되지 않았다는 것입니다. 47행 참조해당 버전의 regex.c. 이는 실행하지 않았 configure
거나 실행했지만 문제가 발생했기 때문에 발생할 수 있습니다.
아직 구성을 실행하지 않았다면 계속해서 실행하세요.
./configure
이를 실행하면 매크로를 특정 값으로 정의하는 config.h
데 사용되는 이라는 파일이 생성됩니다. 그렇지 않은 경우 사용 중인 컴파일러에 의존하는 항목(예: 시스템 헤더 파일)이 누락되었거나 잘못 구성되었거나 잘못 설치되었을 수 있습니다.#define
STDC_HEADERS
위의 의견에서 언급했듯이 사용중인 binutils 버전은 다음과 같습니다.이제 4살이 넘었어요최신 버전을 사용해야 한다고 생각합니다.