gpt4 book ai didi

C 编译器无法在 OpenSUSE 上创建可执行文件

转载 作者:太空宇宙 更新时间:2023-11-04 08:24:17 25 4
gpt4 key购买 nike

我尝试从源代码编译 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

There is my config.log.

我发现了可能的错误:

/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

那么,当我的编译器不工作时如何解决这个问题?

最佳答案

尝试用gcc编译一些简单的代码

#include <stdio.h>
int main () { printf("hello world\n"); return 0; }

用命令

gcc -o simple simple.c

如果出现“command not found”之类的错误,则说明 gcc 不在环境路径中。

还要确保 gcc 可以找到标准头文件(如 stdio.h 和 e.t.c)

关于C 编译器无法在 OpenSUSE 上创建可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31511070/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com