Registering external routines
Posted in 1997
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration
Folks,
If I do this:
/* foo.c */
#include <mi.h>
mi_integer foo_add(mi_integer a, mi_integer b)
{ return a + b; }
and then this:
gcc -Wall -fpic -I/usr/local/ius/incl/public -I/usr/local/ius/incl/esql
-c foo.c
gcc -Wall -fpic -G -o libfoo.so foo.o
and finally this (in dbaccess):
create function foo_add(a int, b int)
returning int;external name "/home/mehus/informix/code/libfoo.so (foo_add)"
language C
end function;
select foo_add(x, y)
from tblfoo;
I get the following error:
9794: User Defined Routine (foo_add) load failed.
The log says:
ERROR: C Language Symbol <foo_add> (procid 651) not found in
</home/mehus/informix/code/libfoo.so>
This I find rather odd; the symbol beeing there when I 'nm' the
library. What am I doing wrong here?
Any help is highly appreciated!
Sindre
--
Sindre Mehus __ mailto:mehus@darmstadt.gmd.de
GMD-IPSI /\\_\\ http://www.cs.uit.no/~sindrem/
Dolivostr. 15 \\/_/ Tel: +49 6151 869 902
D-64293 Darmstadt, Germany Fax: +49 6151 869 966