Problem loading a UDR
Posted in 2006
A user on Informix 10 for Linux compiled a simple C UDR into a shared library (gcc -fpic, ld -shared), registered it, and got error 9793 with the log saying the .so "cannot open shared object file". Suggestions included relinking with gcc -shared -u _etext (which didn't help), adding the path to /etc/ld.so.conf plus ldconfig and checking LD_LIBRARY_PATH, and posting the CREATE FUNCTION statement and directory listings. Jonathan Leffler noted the log showed two different directory names (mydir vs puntoni), hinting at a path mismatch. No confirmed resolution is recorded.
Topics: Platform-Specific Issues
Hello,
I'm using Informix10 on Linux and I'm trying to use a simple UDR, I
compile it as a shared library,
gcc -fpic -c -DLINUX -I$(INFORMIXDIR)/incl/public hello.c
ld -shared hello.o -o hello.so
then I register it in my database.
When I try to use the function, I get a 9793 error and in the log:
17:43:22 The C Language Module </opt/informix/extend/mydir/hello.so>can't load
reason: /opt/informix/extend/puntoni/hello.so: cannot open shared
object file: No such file or directory
17:43:22 (-1): ERROR: Loading Module
</opt/informix/extend/mydir/hello.so>
The file is in the right place and has the right permissions.
Any suggestions??
Thank you,
Dario
Hi,
How about the following ?
gcc -shared -u _etext -o hello.so hello.o
Regards.
--
Tsutomu Ogiwara from Tokyo Japan.
>From: delta77@email.it
>To: informix-list@iiug.org
>Subject: Problem loading a UDR
>Date: 4 Dec 2006 08:50:32 -0800
>
>Hello,
>I'm using Informix10 on Linux and I'm trying to use a simple UDR, I
>compile it as a shared library,
>
>gcc -fpic -c -DLINUX -I$(INFORMIXDIR)/incl/public hello.c
>ld -shared hello.o -o hello.so
>
>then I register it in my database.
>
>When I try to use the function, I get a 9793 error and in the log:
>
>17:43:22 The C Language Module </opt/informix/extend/mydir/hello.so>>can't load
> reason: /opt/informix/extend/puntoni/hello.so: cannot open shared
>object file: No such file or directory
>17:43:22 (-1): ERROR: Loading Module
></opt/informix/extend/mydir/hello.so>>
>The file is in the right place and has the right permissions.
>
>Any suggestions??
>Thank you,
>Dario
>
>_______________________________________________
>Informix-list mailing list
>Informix-list@iiug.org
>http://www.iiug.org/mailman/listinfo/informix-list
_________________________________________________________________
メッセンジャーでファイルのやりとりができる
http://promotion.live.jp/messenger/share.htm
I tried gcc -shared -u _etext -o hello.so hello.o but I get the same error, maybe there's something wrong in the Informix installation? Thank you Dario
delta77@email.it wrote:
> Hello,
> I'm using Informix10 on Linux and I'm trying to use a simple UDR, I
> compile it as a shared library,
>
> gcc -fpic -c -DLINUX -I$(INFORMIXDIR)/incl/public hello.c
> ld -shared hello.o -o hello.so
Let's see the paraform of the function...
>
> then I register it in my database.
Let's see the SQL statement.
>
> When I try to use the function, I get a 9793 error and in the log:
>
> 17:43:22 The C Language Module </opt/informix/extend/mydir/hello.so>> can't load
> reason: /opt/informix/extend/puntoni/hello.so: cannot open shared
> object file: No such file or directory
> 17:43:22 (-1): ERROR: Loading Module
> </opt/informix/extend/mydir/hello.so>>
> The file is in the right place and has the right permissions.
Let's see ls -l of /opt/informix/extend and
ls -l of /opt/informix/extend/puntoni
>
> Any suggestions??
> Thank you,
> Dario
>
delta77@email.it wrote:
> I'm using Informix10 on Linux and I'm trying to use a simple UDR, I
> compile it as a shared library,
>
> gcc -fpic -c -DLINUX -I$(INFORMIXDIR)/incl/public hello.c
> ld -shared hello.o -o hello.so
>
> then I register it in my database.
>
> When I try to use the function, I get a 9793 error and in the log:
>
> 17:43:22 The C Language Module </opt/informix/extend/mydir/hello.so>> can't load
> reason: /opt/informix/extend/puntoni/hello.so: cannot open shared
> object file: No such file or directory
> 17:43:22 (-1): ERROR: Loading Module
> </opt/informix/extend/mydir/hello.so>
So - why is there a 'mydir' in two parts of the message and 'puntoni'
in the other?
> The file is in the right place and has the right permissions.
Which place do you consider right; which permissions do you consider
right?
How did you create the function - what was the statement that
registered it? Did it use an environment variable - if so, what is its
value in the server's environment and in your environment. Maybe
'onstat -g env' will help.
(Someone else asked these question - I'm only posting because I spotted
the mydir vs puntoni difference, and I think that is likely to be
significant.)
hi,
Try this--
Add the following line at the end of /etc/ld.so.conf file
/opt/informix/extend/mydir/hello.so
and run
ldconfig
as root
check your LD_LIBRARY_PATH variable also
Manoj
delta77@email.it
Sent by: informix-list-bounces@iiug.org
04/12/2006 22:20
To
informix-list@iiug.org
cc
Subject
Problem loading a UDR
Hello,
I'm using Informix10 on Linux and I'm trying to use a simple UDR, I
compile it as a shared library,
gcc -fpic -c -DLINUX -I$(INFORMIXDIR)/incl/public hello.c
ld -shared hello.o -o hello.so
then I register it in my database.
When I try to use the function, I get a 9793 error and in the log:
17:43:22 The C Language Module </opt/informix/extend/mydir/hello.so>can't load
reason: /opt/informix/extend/puntoni/hello.so: cannot open shared
object file: No such file or directory
17:43:22 (-1): ERROR: Loading Module
</opt/informix/extend/mydir/hello.so>
The file is in the right place and has the right permissions.
Any suggestions??
Thank you,
Dario
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list