Closed GoogleCodeExporter closed 9 years ago
編譯遇到問題如下:
http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=280353&p=1938550#p1938550
Aron Xu 也有遇到一樣的問題。
*** Warning: Linking the shared library libucimf.la against the
*** static library ./font/libfont.a is not portable!
libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbeginS.o .libs/libucimf_la-options.o
.libs/libucimf_la-graphdev.o .libs/libucimf_la-type.o
.libs/libucimf_la-graphport.o .libs/libucimf_la-window.o
.libs/libucimf_la-widget.o .libs/libucimf_la-shape.o .libs/libucimf_la-cwm.o
.libs/libucimf_la-ucimf.o ./display/libdisplay.a ./font/libfont.a
/usr/lib/libltdl.so -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../..
-L/usr/lib/x86_64-linux-gnu -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crtn.o -Wl,-soname
-Wl,libucimf.so.0 -o .libs/libucimf.so.0.0.0
/usr/bin/ld: ./font/libfont.a(libfont_a-font.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object; recompile with
-fPIC
./font/libfont.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libucimf.la] 错误 1
Original comment by MatLinuxer2
on 23 Jun 2010 at 1:28
解決了。
解法是修正 font/Makefile.am 為:
libfont_la_SOURCES = font.h font.cpp
libfont_la_CPPFLAGS = $(freetype2_CFLAGS) $(fontconfig_CFLAGS) -fPIC
libfont_la_LIBADD = $(freetype2_LIBS) $(fontconfig_LIBS)
同時在其他地方的 _LIBADD, _LDADD 加上 libfont.la
Original comment by MatLinuxer2
on 24 Jun 2010 at 1:46
Original issue reported on code.google.com by
MatLinuxer2
on 21 Jun 2010 at 3:11