在Fedora 15 x86_64上编译wmii

时间:2011-06-02 08:58:26

标签: linux fedora ld

我在Fedora 15上编译wmii v3.9.2时遇到了麻烦;这是有趣的部分(在链接阶段发生的事情):

% bmake -de
MAKE all libbio/
MAKE all libfmt/
MAKE all libregexp/                                                       
MAKE all libutf/
MAKE all libixp/
MAKE all doc/
MAKE all man/
MAKE all cmd/
MAKE all cmd/wmii/
MAKE all cmd/menu/
LD cmd/wmii9menu.out
/usr/bin/ld: wmii/xext.o: undefined reference to symbol 'XRenderFindVisualFormat'
/usr/bin/ld: note: 'XRenderFindVisualFormat' is defined in DSO /usr/lib64/libXrender.so.1 so try adding it to the linker command line
/usr/lib64/libXrender.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

*** Failed target:  wmii9menu.out
*** Failed command: ../util/link "cc" "$(pkg-config --libs 2>/dev/null) -g -L../lib -L/usr/lib64 ../lib/libregexp9.a ../lib/libbio.a ../lib/libfmt.a       ../lib/libutf.a -L../lib -L/usr/lib64 ../lib/libregexp9.a ../lib/libbio.a ../lib/libfmt.a ../lib/libutf.a" wmii9menu.out wmii9menu.o clientutil.o wmii/x11.o   wmii/xext.o wmii/geom.o wmii/map.o util.o ../lib/libixp.a $(pkg-config --libs xft xrandr xinerama) -lXext
*** Error code 1

Stop.
bmake: stopped in /srv/redhat/BUILD/wmii+ixp-3.9.2/cmd

*** Failed target:  dall
*** Failed command: dirs="libbio libfmt libregexp libutf libixp doc man cmd libwmii_hack rc alternative_wmiircs"; set -e; targ=dall; targ=${targ#d}; for i in $dirs; do export WMII_HGVERSION=""; export BASE=$i/; if [ ! -d $i ]; then echo Skipping nonexistent directory: $i 1>&2; else echo MAKE $targ $BASE; (cd $i  && bmake $targ) || exit ; fi; done
*** Error code 1

Stop.
bmake: stopped in /srv/redhat/BUILD/wmii+ixp-3.9.2

最后,在config.mk中,我有以下设置:

...
INCLUDES = -I. -I$(ROOT)/include -I$(INCLUDE) -I/usr/include
LIBS = -L$(ROOT)/lib -L/usr/lib64
...                                                                           
LDFLAGS += -g $(LIBS)
SOLDFLAGS += $(LDFLAGS)
SHARED = -shared -Wl,-soname=$(SONAME)
STATIC = -static
...

通过更多的手动解析,产生错误的语句基本上如下:

gcc \
    -o wmii9menu.out\
    -L../lib -L/usr/lib $(pkg-config --libs xft xrandr xinerama xext)\
    ../lib/libregexp9.a ../lib/libbio.a ../lib/libfmt.a\
    ../lib/libutf.a ../lib/libixp.a\
    wmii9menu.o clientutil.o util.o\
    wmii/x11.o wmii/xext.o wmii/geom.o wmii/map.o

这里,pkg-config解析为以下内容,这本身就完全正确:

-lXft -lXrandr -lXinerama -lXext  

1 个答案:

答案 0 :(得分:1)

解决方案如下:

--- wmii+ixp-3.9.2/config.mk   2011-06-03 14:03:22.950163074 +1000
+++ wmii+ixp-3.9.2/config.mk   2011-06-03 14:03:16.086129011 +1000
@@ -32 +32 @@
-X11PACKAGES = xft
+X11PACKAGES = xft xext xrandr xrender xinerama