간만에 리눅스에 C로 코딩중인데, bool 자료형을 사용 했더니 뜬금없이 아래와 같은 컴파일 에러가 발생했다.
test.c:184:2: error: unknown type name 'bool'
test.c:184:15: error: 'false' undeclared (first use in this function)
test.c:184:15: note: each undeclared identifier is reported only once for each function it appears in
test.c:209:13: error: 'true' undeclared (first use in this function)
찾아보니,
C90은 boolean 자료형을 지원하지 않고,
C99는 아래의 헤더를 사용해야 사용가능하다고 한다.
#include <stdbool.h>
'Programming' 카테고리의 다른 글
Android - List<객체> remove시 exception (0) | 2016.09.03 |
---|---|
Android - 웹페이지에서 앱 실행 (0) | 2016.09.03 |
Shell Script - 슬립 (0) | 2016.09.02 |
Linux C - 컴파일시 sa_family_t 못 찾는 에러 발생시 대처법 (0) | 2016.09.02 |
Linux C - 현재시간 (0) | 2016.09.02 |