【发布时间】:2015-06-12 16:16:26
【问题描述】:
我的代码在使用时编译不正确:
system("gcc -o filename temp.c");
我得到:
implicit declaration of function system
我不确定缺少什么,因为它只会在 gcc 调用时引发系统错误。
这是我的代码:
#include <stdio.h>
int main() {
...
system("gcc -o filename temp.c");
return 0;
}
【问题讨论】:
-
在
#include <stdio.h>之后添加#include <stdlib.h>- 这就是system的原型 - pubs.opengroup.org/onlinepubs/009695399/functions/system.html
标签: c gcc compiler-errors