我在fedora 15上编译wmiv3.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配置解析为以下内容,这本身是完全正确的:
-lXft -lXrandr -lXinerama -lXext

最佳答案

解决方法如下:

--- 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

09-28 01:17