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

  • 相关阅读:
    设计模式之第14章-命令模式(Java实现)
    设计模式之第13章-职责链模式(Java实现)
    设计模式之第12章-享元模式(Java实现)
    我的一年,过去,现在
    Reporting Services 的一些问题
    利用ICSharpCode进行压缩和解压缩
    利用System.Net.Mail 发送邮件
    利用Log4net组件记录日志
    系统权限的设计之简单设计
    利用NPOI组件产Excel完整操作
  • 原文地址:https://www.cnblogs.com/light2018/p/12392481.html
Copyright © 2011-2022 走看看