Subject Trying to compile the FreeAdhocUDF library.
Author plinehan
Hi all,

I'm trying to compile the FreeAdhoc library for Firebird 2.1.3
Classic embedded sever on Linux.

I have the database up and running and can access it using jdbc
and/or isql - create databases, tables, enter data - in short,
everything. I don't want a binary .so precompiled, because I
want to add bits and pieces to the udf library.

Libraries present on the machine

$ /lib/libc (+ TAB, TAB)


and gcc --version gives

gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

I cannot change these libraries or compiler for the moment.

I downloaded the code from and
decided to start with something simple - only compiling and
using 3 of the "modules" - date/math/string stuff.

Issued the commands shown

gcc date_functions.c -Wall -fpic -O -c -I$MY_FB/opt/firebird/include
-I$MY_FB/opt/include -o date_functions.o

compiles - no errors.

gcc math_functions.c -Wall -fpic -O -c -I$MY_FB/opt/firebird/include
-I$MY_FB/opt/include -o math_functions.o

compiles - no errors.

gcc string_functions.c -Wall -fpic -O -c -I$MY_FB/opt/firebird/include
-I$MY_FB/opt/include -o string_functions.o

compiles - no errors.

Note that I explicitly put in the directory - using the -L option.

All of these compiled with no error and produced .o files.

Then I issued the linking command

ld date_functions.o math_functions.o string_functions.o
-o -G -Bsymbolic -L$MY_FB/opt/firebird/lib
-lm -lc -L$MY_FB/opt/firebird/lib/libib_util

Note that I use the -L flag to specify the directories.

Now, if I do

$ ls $MY_FB/opt/firebird/lib/

i.e. list the files in that directory - I get




ls $MY_FB/opt/firebird/include
ib_util.h ibase.h iberror.h perf.h


So, I appear to have all the necessary files(?)

I then copy the created .so to the Firebird embedded
working directory as FreeAdhocUDF (no suffix).

In firebird.conf I put in

UdfAccess = Full in the relevant spot.

Then, I start isql and issue the commad





This is fine.

SELECT F_ROT13(CountryName) FROM Country;

and this is what happens - it crashes out of my isql session
(and also Squirrel sessions) with the message

undefined symbol: ib_util_malloc

Can anybody help me with getting this udf up and running
on my system.

TIA and rgs.