• linux gcc 安装和第一个hello world脚本


    1.安装gcc

    用命令

    sudo apt install gcc      
    
    sudo apt install g++   

    在安装时若出现,404错误,需在安装前执行update命令

    sudo apt install update

    目的是为了使系统能够拥有最新的资源库

    2.linux gcc的第一个hello world脚本

    ①.先输入命令

    gedit hello.c //编辑一个新的 hello.c 文件

    ②.在文本编辑器里写入代码

    #include<stdio.h>
    int main()
    {
      printf("hello world!");
      return 0;  
    }

    ③.代码编写完后进行生成可执行文件,用代码

    gcc hello.c -o test1 //将写好的编码文件hello.c,生成为test1这个可执行文件

    ④.运行可执行文件

    ./test1

    至此linux第一个gcc可执行文件结束。

  • 相关阅读:
    实现CA和证书申请
    1.ssh端口
    1.对称加密6和7的操作
    关于网页访问并发量,统计前十,防火墙
    双指针法
    并查集
    c++常用函数
    vector常用方法
    贪心算法
    字符串类问题
  • 原文地址:https://www.cnblogs.com/boqiang/p/12665175.html
Copyright © 2020-2023  润新知