基础开始,我在公司学习用的是Solaris系统,我要在自己的源文件(mytest.c)中引用apue.h库文件,当执行cc mytest.c发生了以下错误
"/usr/include/sys/feature_tests.h", line 336: #error: "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99"
真要命,后来查了下资料,需要这样写:
cc -DSOLARIS mytest.c
然后就没有问题了,顺利编译出一个文件a.out
"/usr/include/sys/feature_tests.h", line 336: #error: "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99"
真要命,后来查了下资料,需要这样写:
cc -DSOLARIS mytest.c
然后就没有问题了,顺利编译出一个文件a.out
//mytest.c
#include "apue.h"
int main(int argc,char *argv[])
{
return 0;
}