【问题标题】:mysql udf error - can't install in ubuntu 12.04 64 bitmysql udf 错误 - 无法在 ubuntu 12.04 64 位中安装
【发布时间】:2014-03-17 09:31:49
【问题描述】:

我在安装 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

有什么想法吗? TIA

更新:

我已经安装了libmysqlclient15-dev

【问题讨论】:

    标签: mysql ubuntu user-defined-functions


    【解决方案1】:

    尝试使用-fPIC 标志重新编译。它显然暗示了这一点:

    /usr/bin/ld: /tmp/ccw6HRtN.o: relocation R_X86_64_32 against `.rodata' 在制作共享对象时不能使用; 使用 -fPIC 重新编译

    【讨论】:

      【解决方案2】:

      我知道这是一个老问题,但是我刚刚在使用 Ubuntu 16 时遇到了这个问题。

      我通过以下方式解决了更改 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.so
      

      【讨论】:

        猜你喜欢
        • 2012-08-10
        • 1970-01-01
        • 2013-07-23
        • 2015-03-23
        • 1970-01-01
        • 1970-01-01
        • 2015-09-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多