我试图从源代码编译xdebug,但我成为了这个输出:
fobo66@linux-3z16:~/xdebug-2.3.3> ./configure configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for cc... cc checking whether the C compiler works... no configure: error: in `/home/fobo66/xdebug-2.3.3': configure: error: C compiler cannot create executables See `config.log' for more details
我发现了可能的错误:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: i386 architecture of input file '/usr/lib/crt1.o' is incompatible with i386:x86-64 output /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: i386 architecture of input file '/usr/lib/crti.o' is incompatible with i386:x86-64 output /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: i386 architecture of input file '/usr/lib/crtn.o' is incompatible with i386:x86-64 output /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: dynamic STT_GNU_IFUNC symbol 'strcmp' with pointer equality in '/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
那么,当我的编译器无法正常工作时如何解决这个问题呢?
答案 0 :(得分:1)
尝试用gcc编译一些简单的代码
#include <stdio.h>
int main () { printf("hello world\n"); return 0; }
使用命令
gcc -o simple simple.c
如果出现“未找到命令”这样的错误,则gcc不在环境路径中。
还要确保gcc可以找到标准头文件(如stdio.h和e.t.c)
答案 1 :(得分:1)
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
i386 architecture of input file '/usr/lib/crt1.o' is incompatible with
i386:x86-64 output
似乎链接器需要32位版本的所需obj文件,它需要64位。尝试将LD_LIBRARY_PATH环境变量设置为/ usr / lib64中的相应路径,然后重新编译。
答案 2 :(得分:0)
解决!
我只是使用正确的架构重新安装glibc-devel
。
怎么做:
glibc
glibc
和glibc-devel
标记为更新(单击复选框)glibc
包2.19-16.15.1-x86_64
glibc-devel
包并为其执行6和7 此编译后应该正常工作。
这是类似Windows的方法,这就是为什么它很糟糕的原因:)
如果有人知道如何从终端进行,请在此处写下答案。