dbTalk Databases Forums  

C UDR - AIX

comp.databases.informix comp.databases.informix


Discuss C UDR - AIX in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cesar Inacio Martins
 
Posts: n/a

Default C UDR - AIX - 12-16-2011 , 04:40 AM






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.o
collect2: get_transid.so: cannot open as COFF file

$ 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

===========================================

I'm already try some differ approach on "-g" parameter (-gxcoff ,
gxcoff+) without success.


Anyone?
Regards
Cesar

Reply With Quote
  #2  
Old   
Richard Harnden
 
Posts: n/a

Default Re: C UDR - AIX - 12-19-2011 , 02:02 PM






On 16/12/2011 10:40, Cesar Inacio Martins wrote:
Quote:
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.

Quote:
$ 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.

Quote:
$ 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.

Quote:
===========================================

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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.