Solaris 11에서 apue.h의 헤더 파일을 이용한 컴파일시 오류

conpsyche의 이미지

소스는 아래와 같습니다.

#include "apue.h"
 
int
main(int argc, char *argv[])
{
        return 0;
}

#gcc -o test test.c
In file included from /usr/include/sys/types.h:12:0,
from apue.h:13,
from test.c:1:
/usr/include/sys/feature_tests.h:358:2: error: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99"
#error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
^

구글링을 해도 모르겠네요 ㅡㅡ

익명 사용자의 이미지

-std=c99 붙여서 컴파일해보세요.

conpsyche의 이미지

정말 -std=c99
붙여서 컴파일하니 되내요
감사합니다.
이거때문에 이틀이나 구글링했는데 ㅋㅋㅋ