我想在Linux(Linuxmint8)上运行第一个c程序。 正在使用gcc或g。 两者都有同样的问题。编译器找不到要导入的库。
我认为应该复制工作文件夹中的iostream.h文件(不知道在哪里查找),将文件移动到其他位置进行编译,或者使用某些选项。
谢谢您的建议。
以下是GCC命令、c代码、错误消息:
gcc -o addition listing2.5.c
同调
#包含
intaddition(inta,int b ) )。
{
返回(ab );
}
int main () )
{
计数结果:管理(2,4 ) 'n ';
返回0;
}
同调
listing 2.5.c :1:22: error : iostream.h : nosuchfileordirectory
listing 2.5.c : infunctionmain :
列表2.5.c :10:错误:计数取消(firstuseinthisfunction ) )。
listing 2.5.c :10:错误: (eachundeclaredidentifierisreportedonlyonce
listing 2.5.c :103360 error : foreachfunctionitappearsin.)
代码将被编译,但不能使用文件名从命令行执行。
addition: command not found
你有什么建议吗?