我在安装mysql udf (https://github.com/mysqludf/lib_mysqludf_sys)时遇到了问题。下面是我得到的信息:
Compiling the MySQL UDF
gcc -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o /usr/lib/lib_mysqludf_sys.so
/usr/bin/ld: /tmp/ccw6HRtN.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tmp/ccw6HRtN.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [install] Error 1
ERROR: You need libmysqlclient development software installed
to be able to compile this UDF, on Debian/Ubuntu just run:
apt-get install libmysqlclient15-dev有什么想法吗?提亚
更新:
我已经安装了libmysqlclient15-dev。
发布于 2014-04-21 15:54:36
尝试使用-fPIC标志重新编译。这显然暗示了这一点:
/usr/bin/ld: /tmp/ccw6HRtN.o:生成共享对象时不能使用针对`.rodata的重定位R_X86_64_32;使用-fPIC重新编译
发布于 2018-04-12 17:51:34
我知道这是一个老生常谈的问题,但是我在使用Ubuntu16的时候遇到了这个问题。
我通过以下方式解决了更改Makefile的问题:as explained in a GitHub issue
LIBDIR=/usr/lib/mysql/plugin
install:
gcc -DMYSQL_DYNAMIC_PLUGIN -fPIC -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o $(LIBDIR)/lib_mysqludf_sys.sohttps://stackoverflow.com/questions/22450725
复制相似问题