I am trying to load the open-source MySQL-UDFs available here:
http://mysql-udf.sourceforge.net
It compiles OK...:
- Code: Select all
> gcc -Wall -I /usr/include/mysql -I /usr/local/include -c udf_median.cc -o udf_median.o
...Links OK...:
- Code: Select all
> ld -shared -o udf_median.so udf_median.o
...I copy it to the correct directory...:
- Code: Select all
> cp udf_median.so /opt/lampp/lib
...Go into MySQL:...
- Code: Select all
> /opt/lampp/bin/mysql -uroot
... But, when I try to load the function into MySQL:
- Code: Select all
mysql> CREATE AGGREGATE FUNCTION median RETURNS REAL SONAME 'udf_median.so';
I get the following error:
- Code: Select all
ERROR 1126 (HY000): Can't open shared library 'udf_median.so' (errno: 22 /opt/lampp/lib/udf_median.so: undefined symbol: _Znwj)
Does any of you have an idea, what I am doing wrong?