In the last episode (Nov 17), Troy Bowman said:
> On Sat, 17 Nov 2001, Sinisa Milivojevic wrote:
> > > mysql> CREATE FUNCTION lookup RETURNS STRING SONAME
> > > ERROR 1126: Can't open shared library 'libudf_example.so' (errno: 0
> /usr/lib/libudf_example.so: unsupported file type)
> > Please check a type of the above ...so file with a file command.
> > Also check execute permissions.
> File type is:
> /usr/lib/libudf_int_ip.so: ELF 32-bit LSB relocatable, Intel 80386, version 1
> (FreeBSD), not stripped
> What should it be? Any hints on how to get it right?
The file type should read "shared object" instead of "relocatable".
The correct procedure for building a udf is in the manual, under
"Compiling and Installing User-definable Functions". For FreeBSD, you
can pretty much use the example in the docs:
gcc -I /usr/local/include/mysql -shared -o udf_myfunc.so myfunc.c
If your file is c++, add "-felide-constructors -fno-implicit-templates
-fno-exceptions fno-rtti", just to match the rest of mysqld (not sure
if it's required or not).