首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Linux/Unix C, 学习《Unix环境高级编程》在Solaris OS上编译文件源码

2012-12-22 
Linux/Unix C, 学习《Unix环境高级编程》在Solaris OS下编译文件源码基础开始,我在公司学习用的是Solaris系

Linux/Unix C, 学习《Unix环境高级编程》在Solaris OS下编译文件源码
基础开始,我在公司学习用的是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

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

热点排行