zoukankan      html  css  js  c++  java
  • linux 跨版本问题

    1 //redhattest.c
    2  #include <stdio.h>
    3  int main()
    4 {
    5 int a=0;
    6
    7 printf ("this is compiled in Red Hat, %d\n",a);
    8
    9 return 0;
    10 }
    11
    gcc -o RadHatTest redhattest.c

    编译完之后放到centos上运行可以正常运行

    Red Hat版本信息
    Red Hat Enterprise Linux AS release 3 (Taroon Update 5)
    Kernel \r on an \m

    Linux version 2.4.21-32.EL (bhcompile@tweety.build.redhat.com) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-52)) #1 Fri Apr 15 21:17:56 EDT 2005
    2.4.21-32.EL
    gcc版本信息
    gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-52)
    Copyright (C) 2002 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    1 //centostest.c
    2  #include <stdio.h>
    3 int main()
    4 {
    5 int a=0;
    6
    7 printf ("this is compiled in Centos, %d\n",a);
    8
    9 return 0;
    10 }
    11
    gcc -o CentosTest centostest.c
    编译完之后放到red hat上运行得到"浮点数例外"的错误信息
    centos 版本信息

    CentOS release 5.5 (Final)
    Kernel \r on an \m

    Linux version 2.4.21-32.EL (bhcompile@tweety.build.redhat.com) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-52)) #1 Fri Apr 15 21:17:56 EDT 2005

    2.6.18-194.8.1.el5
    gcc版本信息

    gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  • 相关阅读:
    The 16th Zhejiang Provincial Collegiate Programming Contest Sponsored(E F G H I)
    Ubuntu iso下载地址(14、16、18)
    JS解决在提交form表单时某个值不存在 alter弹窗点确定不刷新界面
    搞搞电脑微信表情的破解(.dat转png or jpg)
    12.29 模拟赛
    bzoj 2151 种树
    bzoj 5110 Yazid的新生舞会
    【系列】 点分治
    12.8 模拟赛
    12.17 模拟赛
  • 原文地址:https://www.cnblogs.com/eavn/p/1810369.html
Copyright © 2011-2022 走看看