compiling and linking IDS2000 UDR on HP-UX 10.20
Posted in 2001
My environment:
IDS2000 9.21.UC2
HP-UX 10.20
Does anyone have experience linking/compiling/using an IDS2000 UDR on
HP-UX 10.20?
my create function() works just fine.
But when I call the function in an SQL statement, online.log shows:
17:10:16 Loading Module </opt/informix/extend/quarter/howdy.bld>
17:10:16 The C Language Module </opt/informix/extend/quarter/howdy.bld>loaded
17:10:16 Assert Failed: Exception Caught. Type: MT_EX_OS, Context: ill
17:10:16 Informix Dynamic Server 2000 Version 9.21.UC2
17:10:16 Who: Session(17, informix@houdini, 28477, -1024488784)
Thread(41, sqlexec, c2ec9e04, 1)
File: mtex.c Line: 356
17:10:16 Action: Please notify Informix Technical Support.
17:10:16 stack trace for pid 26551 written to /tmp/af.4114667
17:10:17 See Also: /tmp/af.4114667, shmem.4114667.3
17:10:34 (-9791): ERROR: Routine execution trap -- procname=<howdy>
procid=181
reason: ill
So this indicates that I have an illegal instruction. But the function
is so
simple (it just returns the text "Howdy!"), that I think its some sort
of
linker problem.
I am using Jacques Roy's excellent "IDS2000 Server-Side Programming in
C", but
all of the examples are for Solaris, not for HP-UX.
Here's my function source:
#include <stdio.h>
#include <mi.h>
mi_lvarchar *howdy(MI_FPARAM *fparam)
{
mi_lvarchar *RetVal ;
char buffer[10] ;
strcpy(buffer,"Howdy!") ;
RetVal = mi_new_var(strlen(buffer)) ;
mi_set_vardata(RetVal,buffer) ;
return RetVal ;
}
Here's my compile line:
gcc -DMI_SERVBUILD -I$INFORMIXDIR/incl/public -c howdy.c
And my link line:
ld -b -o howdy.bld $INFORMIXDIR/lib/dmi/libdmi.a howdy.o
Does ESQL/C enter in any way into compiling a C UDR? Or is that a
different
beast altogether? Do I have to use a specific compiler? Won't gcc
work?
Any help greatly appreciated
Allen Jantzen, DBA
Ned Davis Research