2015-07-20 42 views
0
创建可执行文件

我试图编译来源Xdebug的,但我成为这个输出:C编译器不能在openSUSE

[email protected]:~/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

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

+0

您是否安装了GCC编译器? –

+0

当然!cc和gcc都是这样,它与Zypper模式“C/C++ Development”一起发货。 – fobo66

回答

0

解决!

我刚刚重新安装了glibc-devel正确的架构。

如何做到这一点:

  1. 转到YaST中
  2. 选择 “软件管理” 工具
  3. 在搜索字段中键入glibc
  4. 马克包更新glibcglibc-devel(点击复选框)
  5. 选择glibc
  6. 点击第e底部的“版本”选项卡
  7. 选择具有正确架构的版本,例如2.19-16.15.1-x86_64
  8. 选择glibc-devel包并做6,7它
  9. 点击“接受”
  10. 等待安装
  11. 年底关闭窗口

这个编译后应能正常工作。

这是类似Windows的方法,这就是为什么它吮吸:)原因

当有人知道如何从终端做到这一点,写答案这里。

1

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

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

与命令

gcc -o simple simple.c 

是否会有这样的“未找到命令”错误,然后再GCC不位于环境中的路径。

也确保GCC可以找到标准头文件(如stdio.h中和等)

+0

奇怪。有一个gcc的输出:'gcc -o simple simple.c 来自/usr/include/features.h:402:0, 的文件来自/usr/include/stdio.h:27, from simple.c :1: /usr/include/gnu/stubs.h:10:27:致命错误:GNU /存根-64.h:Неттакогофайлаиликаталога #包括 ^ 编译终止.' – fobo66

+0

啊,试试安装glibc-devel :) –

+0

它已经安装好了,但是对于i686架构。 – fobo66

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 看来连接越来越需要它其中的64位所需要的OBJ文件的32位版本。尝试将LD_LIBRARY_PATH环境变量设置为来自/ usr/lib64的适当路径,然后重新编译。

+0

为什么'/ usr/lib64'中不需要64位'crt1.o'等文件。也许,我在错误的位置搜索? – fobo66

+0

'/ usr/lib *'中是否没有名为'crt1.o'的文件?如果没有,那么你的系统可能缺少'glibc-devel'软件包。您可以使用命令'rpm -qa |检查它们是否实际安装grep glibc'。如果未安装,请尝试安装'glibc-devel'软件包。 – aks

+0

它已经安装,但为i686架构。我如何重新安装x86-64? – fobo66