A dynamicly loadable file should be compiled sharable (something like: 'gcc -shared -o udf_example.so myfunc.cc'). You can easily get all switches right by doing: 'cd sql ; make udf_example.o' Take the compile line that make writes, remove the '-c' near the end of the line and add -o udf_example.so to the end of the compile line. The resulting library (udf_example.so) should be copied to some dir searched by ld, for example /usr/lib.