[Linux] 关于64位系统

来源:互联网 发布:vs2017 js智能提示 编辑:程序博客网 时间:2024/05/14 14:43

1. 判断Linux系统是32位还是64位的方法:

$  getconf LONG_BIT 

 

2.判断一个文件是32位还是64位的方法:

$ $ file libXXXX.so
libsysSp.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped

 

3.编译过程中,如果出现如下错误,是由于在64位上使用了32位的库。

/usr/bin/ld: warning: i386 architecture of input file `../lib/libXXXX.a(tree_op.o)' is incompatible with i386:x86-64 output

对策:在编译选项中追加 -m32     (未确认)

gcc -m32

原创粉丝点击