64位Linux编译C代码,crt1.o文件格式不对的问题
今天在某台64位LInux下编译一个简单的hello world的C程序,报错:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: could not read symbols: File in wrong format
查看该文件的格式,竟然是32位的:
# file /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.18, not stripped
查看glibc-devel版本:
# yum info glibc-devel
Installed Packages
Name : glibc-devel
Arch : i686
Version : 2.12
Release : 1.149.el6_6.5
Size : 955 k
Repo : installed
From repo : 6ASU5-updates
Summary : Object files for development using standard C libraries.
URL : http://sources.redhat.com/glibc/
License : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Description : The glibc-devel package contains the object files necessary
: for developing programs which use the standard C libraries (which are
: used by nearly all programs). If you are developing programs which
: will use the standard C libraries, your system needs to have these
: standard object files available in order to create the
: executables.
:
: Install glibc-devel if you are going to develop programs which will
: use the standard C libraries. Available Packages
Name : glibc-devel
Arch : x86_64
Version : 2.12
Release : 1.149.el6_6.5
Size : 983 k
Repo : 6ASU5-updates
Summary : Object files for development using standard C libraries.
URL : http://sources.redhat.com/glibc/
License : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Description : The glibc-devel package contains the object files necessary
: for developing programs which use the standard C libraries (which are
: used by nearly all programs). If you are developing programs which
: will use the standard C libraries, your system needs to have these
: standard object files available in order to create the
: executables.
:
: Install glibc-devel if you are going to develop programs which will
: use the standard C libraries.
在其他正常的64位机器上,发现是有/usr/lib64/crt1.o文件的,而问题机器却没有改文件,只有/usr/lib/crt1.o文件。
询问牛人,牛人用了以下命令查看正常机器上的crt1.o文件:
# rpm -qf /usr/lib64/crt1.o
glibc-devel-2.12-1.149.el6_6.5.x86_64
原来是问题机器只安装了glibc-devel.i686,没有安装glibc-devel.x86_64,用yum安装即可:
yum install glibc-devel.x86_64
安装成功后,一切正常!!!
64位Linux编译C代码,crt1.o文件格式不对的问题的更多相关文章
- 关于64位Linux编译hadoop2
Apache官方提供hadoop2的安装包是在32位机器下编译的,生产环境一般使用64的Linux,那么需要在64位机器下重新编译可以查看hadoop-2.2.0-src下的BUILDING.txtB ...
- 64位linux编译32位程序
昨天接到的任务,编译64位和32位两个版本的.so动态库给其他部门,我的ubuntu虚拟机是64位的,编译32位时遇到了问题: /usr/bin/ld: cannot find -lstdc++ 最后 ...
- 64位Linux编译hadoop-2.5.1
Apache Hadoop生态系统安装包下载地址:http://archive.apache.org/dist/ 软件安装目录:~/app jdk: jdk-7u45-linux-x64.rpm ha ...
- 在64位linux下编译32位程序
在64位linux下编译32位程序 http://blog.csdn.net/xsckernel/article/details/38045783
- linux下hadoop2.6.1源码64位的编译
linux下hadoop2.6.1源码64位的编译 一. 前言 Apache官网上提供的hadoop本地库是32位的,如果我们的Linux服务器是64位的话,就会现问题.我们在64位服务器执行Hado ...
- MiniCRT 64位 linux 系统移植记录:64位gcc的几点注意
32位未修改源码与修改版的代码下载: git clone git@github.com:youzhonghui/MiniCRT.git MiniCRT 64位 linux 系统移植记录 MiniCRT ...
- /usr/local/lib/libz.a: could not read symbols: Bad value(64 位 Linux)
/usr/local/lib/libz.a: could not read symbols: Bad value(64 位 Linux) /usr/bin/ld: /usr/local/lib/lib ...
- 64位linux报错Could not initialize class java.awt.image.BufferedImage
最近碰到一个问题: 64位linux报错Could not initialize class java.awt.image.BufferedImage 在WIN平台下运行正常BufferedImage ...
- class文件无论是32位还是64位jdk编译出来的,都可以通用
class文件无论是32位还是64位jdk编译出来的,都可以通用 学习了:https://blog.csdn.net/z3111001358/article/details/53364066 java ...
随机推荐
- 移动端meta汇总
part1 一.天猫(http://m.tmall.com) <title>天猫触屏版</title> <meta content="text/html; ch ...
- C#5.0 异步编程async/await用法
微软在发布VS2012的同时推出了C#5.0,其中包含了async和await 代码如下: class Program { private static readonly Stopwatch watc ...
- Python之路,Day5 - 常用模块学习 (转载Alex)
本节大纲: 模块介绍 time &datetime模块 random os sys shutil json & picle shelve xml处理 yaml处理 configpars ...
- iOS项目转移到自动引用计数
这里主要参考了Apple官方文档:Transitioning to ARC Release Notes 在支持iOS5的Xcode4中,创建项目会看到这样的选项: 这是iOS5的新特性,自动对象引用计 ...
- Codeforces 113C
题目链接 C. Double Happiness time limit per test 5 seconds memory limit per test 128 megabytes input sta ...
- css3烟花效果
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
- Android——兼容性
两种类型的兼容性:设备兼容性和应用兼容性. 设备的Android兼容性就是app能够正确运行的Android执行环境(Android execution environment).Android执行环 ...
- Oracle操作XML各种场景介绍
版权声明:凭栏处.潇潇雨歇. https://blog.csdn.net/IndexMan/article/details/28130961 近期在研究Oracle PLSQL中对于XML的系列操作. ...
- 来实现一个缩水版Vuex
对 Vuex 源码进行浓缩,DIY 一个小型 Vuex 功能如下 通过 $store.commit 改变 $store.state 实现 strict model 源码约70行左右比较好理解,下面讲解 ...
- Leetcode925.Long Pressed Name长按键入
你的朋友正在使用键盘输入他的名字 name.偶尔,在键入字符 c 时,按键可能会被长按,而字符可能被输入 1 次或多次. 你将会检查键盘输入的字符 typed.如果它对应的可能是你的朋友的名字(其中一 ...