由于ELFCLASS64错误,如何使用“make”来使用64位库

时间:2009-08-07 01:14:54

标签: c++ gcc makefile compilation

如何使用configure和make工具指定使用64位库?我认为这是自动的,但我错了ELF Class。

我正在尝试为Ubuntu 64编译Xdebug,以便与LAMPP(XAMPP for Linux)一起使用。

./lampp start 

Failed loading /opt/lampp/lib/php/extensions/xdebug.so:  /opt/lampp/lib/php/extensions/xdebug.so: wrong ELF class: ELFCLASS64

./configure对我来说看起来不错,并且make工作没有错误,我已经复制了配置,以防相关:

/xdebug-2.0.3$ ./configure

checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
checking for PHP extension directory... /usr/lib/php5/20060613
checking for PHP installed headers prefix... /usr/include/php5
checking for re2c... no
configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable eXtended debugging support... yes, shared
checking for gettimeofday... yes
checking for cos in -lm... yes
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands

5 个答案:

答案 0 :(得分:2)

我不确定错误,但为什么要编译xdebug?它在Ubuntu的存储库中可用作php5-xdebug(sudo apt-get install php5-xdebug)。虽然你没有提到你的发行版,也许它的名字相似?

但是要回答你的问题,错误信息看起来像xdebug 64位,但这是一个问题(是什么灯泡执行32位二进制文​​件?)

答案 1 :(得分:1)

不会:

LD_LIBRARY_PATH=/lib64:$LD_LIBRARY_PATH ./lampp start

工作?我不使用Ubuntu,所以你的路径可能会有所不同。一件事是

ldd ./lampp

查看默认可执行文件指向的内容。

答案 2 :(得分:1)

尝试指向32位库,LD_LIBRARY_PATH=/lib32:LD_LIBRARY_PATH

如果不起作用,请尝试64位库,LD_LIBRARY_PATH=/lib64:LD_LIBRARY_PATH

完成命令:

sudo ./configure --enable-xdebug --with-php-config=/opt/lampp/bin/php-config LD_LIBRARY_PATH=/lib32:LD_LIBRARY_PATH

答案 3 :(得分:1)

xdebug正在以32位编译。使用以下方法编译它:

CXXFLAGS="-m64" CFLAGS="-m64" LDFLAGS="-m64" ./configure --enable-xdebug

在SPARC Solaris 10上为我工作。

答案 4 :(得分:0)

可能运行时链接程序的库路径错误。目录/ opt / lampp / lib64是否存在? lampp是shell脚本吗?如果是这样,它设置LD_LIBRARY_PATH变量的值(以及是否)?