Page 1 of 1

UDF

PostPosted: 20. May 2007 13:16
by erelsgl
Hi,

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?

PostPosted: 20. May 2007 13:31
by Wiedmann
You have compiled and linked this lib with/against your system MySQL and not the MySQL from XAMPP.

--> download the XAMPP devel package and compile this again with the XAMPP MySQL headers