28 七月, 2008

[build error:] relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

接下来的错误反馈一般是 xxxxxx.a: could not read symbols: Bad value

今天在64位Linux上编译MonetDB的时候碰到这个问题,这里有答案:

You will get these messages on x86_64 any place that libtool tries to use a static (.a) library in a .la, and as it says, it can't link. These "recompile with -fPIC" messages fall into three types -

  1. recompile the current package with -fPIC
  2. fix a broken symlink (I had a dangling symlink for ncurses in my scripts, because of a typo - on x86 libtool couldn't find the .so but took the .a and ran with it, on x86_64 it barfed)
  3. convert a Makefile to use .la instead of .a (very uncommon)

我采用的是第2种解决方法,就是将xxxxxx.a链接到正确的shared library (.so)上


最新回复
发表评论


















Bold Italic Link