Linux 编译运行 C/C++程序
2011-08-08 22:22
375 查看
终端输入命令
emacs
打开emacs编辑器。编写代码
#include <iostream>
using namespace std;
int main()
{
cout<<"hello world.."<<endl;
return 0;
}
保存为test.cpp
在终端敲击键盘ctr+Z进入终端命令行
输入命令行,进行编译(若是C语言,使用gcc代替g++)
g++ test.cpp -o testcpp
运行命令:
./testcpp
运行结果:
hello world..
可以使用emacs test.cpp进行对程序进行修改。
emacs
打开emacs编辑器。编写代码
#include <iostream>
using namespace std;
int main()
{
cout<<"hello world.."<<endl;
return 0;
}
保存为test.cpp
在终端敲击键盘ctr+Z进入终端命令行
输入命令行,进行编译(若是C语言,使用gcc代替g++)
g++ test.cpp -o testcpp
运行命令:
./testcpp
运行结果:
hello world..
可以使用emacs test.cpp进行对程序进行修改。
相关文章推荐
- Linux下如何编译、运行C、C++程序?
- 让C/C++程序一次编译,到处运行 (仅限Linux)
- linux下编辑并编译运行C/C++/python程序
- Android 运行 C/C++程序 (使用 arm-linux-gcc 交叉编译环境)
- Android 运行 C/C++程序 (使用 arm-linux-gcc 交叉编译环境)
- linux下使用gcc编译运行C/C++程序
- Linux下使用GCC编译并运行第一个helloworldC++程序
- linux编译运行C/C++程序
- Visual Studio 2005中如何编译和运行C++程序【转载】
- win10中eclipse中编译和运行C/C++程序
- [Linux]在ubuntu系统下编译运行c程序并使用makefile管理项目
- Linux巩固记录(5) hadoop 2.7.4下自己编译代码并运行MapReduce程序
- linux下运行《UNIX环境高级编程》的第一个程序时源码编译出错的处理方法
- linux下c++多线程下统计程序运行时间(非常注意)
- 在未安装VS2005的机器上运行VS2005编译的C++程序(转)
- 在linux环境下编译运行OpenCV程序的两种方法
- 解决linux/Ubuntu下Qt creater 界面程序在编译运行后无法显示中文或中文乱码问题!
- Linux下编译运行C程序
- C/C++程序编译时和运行时内存区域分配
- C/C++程序编译运行生成过程分析