C UDR - AIX
Posted in 2011
Topics: Stored Procedures & SPL, Triggers, Constraints & Referential Integrity, Platform-Specific Issues
Hi ,
IFX 11.50 FC9X6 , AIX 6.1
I'm trying create a simple UDR to get the current 'transaction id' with
less overhead possible...
To use this UDR inside of SPL + Trigger...
I'm not expert on C language, where play with it sometimes...
So , I getting some trouble to compile the .c file, what I not sure if
is some problem with gcc for AIX or the command line used...
I'm stuck on error 'collect2: get_transid.so: cannot open as COFF file'
... and following the John Miller IIUG/2010 presentation 'The Basics of
Writing and Utilizing C-User Define Routines'...
If anyone have any tips how solve this, I appreciate a lot...
===========================================
$ cat get_transid.c
#include "incl/public/mi.h"
#include "incl/public/milib.h"
mi_integer get_transid(void){
mi_integer transid ;
transid = mi_get_transaction_id() ;
return transid ;
}
$ gcc -g -Wall -fPIC -I/vulca/informix -c get_transid.c
$ l get*
-rw-rw-r-- 1 informix informix 178 Dec 15 14:09 get_transid.c
-rw-rw-r-- 1 informix informix 30140 Dec 16 07:35 get_transid.o
$ gcc -shared -Wl,-soname,get_transid.so -o get_transid.so get_transid.ocollect2: get_transid.so: cannot open as COFF file
$ gcc --version
gcc (GCC) 4.2.0Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ ld --versionGNU find version 4.1
===========================================
I'm already try some differ approach on "-g" parameter (-gxcoff ,
gxcoff+) without success.
Anyone?
Regards
Cesar
On 16/12/2011 10:40, Cesar Inacio Martins wrote:
> Hi ,
>
> IFX 11.50 FC9X6 , AIX 6.1
>
>
> I'm trying create a simple UDR to get the current 'transaction id' with
> less overhead possible...
> To use this UDR inside of SPL + Trigger...
>
> I'm not expert on C language, where play with it sometimes...
> So , I getting some trouble to compile the .c file, what I not sure if
> is some problem with gcc for AIX or the command line used...
> I'm stuck on error 'collect2: get_transid.so: cannot open as COFF file'
>
> ... and following the John Miller IIUG/2010 presentation 'The Basics of
> Writing and Utilizing C-User Define Routines'...
>
> If anyone have any tips how solve this, I appreciate a lot...
>
> ===========================================
> $ cat get_transid.c
> #include "incl/public/mi.h"
> #include "incl/public/milib.h">
> mi_integer get_transid(void){
> mi_integer transid ;
> transid = mi_get_transaction_id() ;
> return transid ;
> }
>
> $ gcc -g -Wall -fPIC -I/vulca/informix -c get_transid.c
> $ l get*
> -rw-rw-r-- 1 informix informix 178 Dec 15 14:09 get_transid.c
> -rw-rw-r-- 1 informix informix 30140 Dec 16 07:35 get_transid.o
So, it compiled to an object fine.
>
> $ gcc -shared -Wl,-soname,get_transid.so -o get_transid.so get_transid.o> collect2: get_transid.so: cannot open as COFF file
What happens without the "-W1,..." switch?
Try ld -G to make the .so, something more like:
$ ld -G get_transid.o -o get_transid.so
Not sure what switches AIX requires, I think the machine/release notes say.
>
> $ gcc --version
> gcc (GCC) 4.2.0> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> $ ld --version> GNU find version 4.1
"find" ???
That can't be right, find and ld are very different programs.
>
> ===========================================
>
> I'm already try some differ approach on "-g" parameter (-gxcoff ,
> gxcoff+) without success.
>
>
> Anyone?
> Regards
> Cesar
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1890 / Virus Database: 2108/4690 - Release Date: 12/19/11