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 ...
随机推荐
- input[type=file]上传图片及转为base64码以及预览
<input type="file" id="imgurl" capture="camera" accept="image/ ...
- Lvs 环境搭建 vbox搭建centos6.9 vbox设置 centos上安装nginx
1.现在vbox上虚拟出3个虚拟机,分别为负载均衡器(Load Balance).实际服务器1(Real server1).实际服务器2(Real Server2) 要点: :vbox系统网络连接方式 ...
- laravel-admin 报错 Disk [admin] not configured, please add a disk config in `config/filesystems.php`.
在config/filesystems.php中添加: 'disks' => [ 'local' => [ 'driver' => 'local', 'r ...
- mybatis深入理解(三)-----MyBatis事务管理机制
MyBatis作为Java语言的数据库框架,对数据库的事务管理是其非常重要的一个方面.本文将讲述MyBatis的事务管理的实现机制.首先介绍MyBatis的事务Transaction的接口设计以及其不 ...
- JSP-Cookie和Session
1 会话技术简介 1.1 存储客户端状态 1.2 会话技术 2 Cookie技术 2.1 Cookie技术的购物 2.2 服务器端向客户端发Cookie //1.创建cookie对象 Cookie c ...
- iTerm2+oh-my-zsh配色
效果图,很帅气有木有 一.首先安装iTem2 安装好后的截图如下: 安装好后的截图 二.安装oh-my-zsh. sh -c "$(curl -fsSL https://raw.gi ...
- js实现放大镜特效的实现方法
<!doctype html><html lang="en"><head> <meta charset="UTF-8" ...
- jsp页面_按回车键触发事件
一般在列表页面中,都会带有查询按钮,当输入完查询条件后,如果需要通过鼠标点击"查询"按钮才发起查询,那么就感觉不够方便,那么我们就可以修改为按下回车键的时候发起查询. <sc ...
- 二维码识别项目zxing横屏改为竖屏
第1步: 在AndroidManifest中将CaptureActivity的screenOrientation属性做如下修改: android:screenOrientation="por ...
- Legal or Not HDU - 3342 (拓扑排序)
注意点: 输入数据中可能有重复,需要进行处理! #include <stdio.h> #include <iostream> #include <cstring> ...