c c++ 在linux上编译
来源:互联网 发布:mysql nosql 编辑:程序博客网 时间:2024/05/17 21:54
C语言编译:gcc[options] [filenames]
当不使用任何编译选项编译hello.c时,gcc将会自动编译产生一个a.out的可执行文件:
vim test1.c
root@ubuntu-daisy:~/daisy# cat test1.c
#include<stdio.h>
int main(){
printf("helloxiujuan!\n");
}
gcc test1.c
linux会自动生成a.out 文件
./a.out
输出结果 hello Xiujuan
使用-o编译选择,可以为编译后的文件指定一个名字:
root@ubuntu-daisy:~/daisy# ls
test1.c
root@ubuntu-daisy:~/daisy# gcc test1.c -o hello
root@ubuntu-daisy:~/daisy# ls
hello test1.c
root@ubuntu-daisy:~/daisy# ./hello
Hello World!
C++ 编译:
vim test2.cc
root@ubuntu-daisy:~/daisy# cat test2.cc
#include <iostream>
using namespace std;
int main(){
cout <<" hello world" <<endl;
}
g++ test2.cc
linux会自动生成a.out文件
./a.out
输出结果hello world
0 0
- c c++ 在linux上编译
- RabbitMQ-c在Linux上编译
- linux上编译C
- 在Linux上安装NetBeans来编译C程序
- json-c-0.9 在linux上编译使用
- json-c-0.9 在linux上编译使用
- 在Linux&ubuntu上编译C语言程序
- json-c-0.9 在linux上编译使用
- json-c-0.9 在linux上编译使用的方法
- 如何在 Windows上编译Objective-C
- 如何在 Windows上编译Objective-C
- 如何在 Windows上编译Objective-C
- 在Windows上编译MongoDB C Driver
- 如何在Windows上编译Objective-C
- 在Windows上编译MongoDB C Driver
- json-c-0.9 在linux上编译使用 以及使用注意事项
- PRO*C 在linux下如何编译
- lua c在linux下的编译
- 静默获取用户基本信息的一种方法
- ALV报表
- 2017 新起点
- tomcat jdbc pool 连接池配置
- 表格demo
- c c++ 在linux上编译
- 文件上传工具--dropzone.js
- 经典的机器学习方面源代码库 转载备用
- SpringMVC刘宝宝深度版
- Android开发将List转化为JsonArray和JsonObject
- IOC初认识
- iOS之网络—— NSURLSessionDataTask文件离线断点下载、NSURLSession文件上传、AFN基本使用、Cocoapods安装
- contos firewalld 打开或关闭端口
- 关于PHP程序员解决问题的能力