zoukankan      html  css  js  c++  java
  • Centos安装 gcc g++

    1 联网环境

    yum -y install gcc gcc-c++ kernel-devel

    2 检测 gcc -v

    [root@localhost libpcap]# gcc -v
    使用内建 specs。
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
    目标:x86_64-redhat-linux
    配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
    线程模型:posix
    gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

    3 检测 g++ -v

    使用内建 specs。
    COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
    目标:x86_64-redhat-linux
    配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
    线程模型:posix
    gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

    4 编译c 文件

    vi hello.c

    #include <stdio.h>

    int main()
    {
      printf("Linux ");
      return 0;
    }

    gcc -o hello hello.c

    ./hello

  • 相关阅读:
    [kuangbin带你飞]专题七 线段树
    [kuangbin带你飞]专题六 最小生成树
    [kuangbin带你飞]专题五 并查集
    [kuangbin带你飞]专题四 最短路练习
    [kuangbin带你飞]专题三 Dancing Links
    [kuangbin带你飞]专题二 搜索进阶
    [kuangbin带你飞]专题一 简单搜索
    常用算法模板
    ACM程序设计选修课——Problem E:(ds:图)公路村村通(Prim)
    HDU——5667Sequence(矩阵快速幂+费马小定理应用)
  • 原文地址:https://www.cnblogs.com/light2018/p/12392481.html
Copyright © 2011-2022 走看看