Unix Technical Forum

Compiling Pro*C Flatten.pc For Spooling

This is a discussion on Compiling Pro*C Flatten.pc For Spooling within the Oracle Database forums, part of the Database Server Software category; --> Hi, I've got flatten.pc off: asktom.oracle.com/~tkyte which spools a table and I'm trying to compile it. I successfully executed ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-24-2008, 12:24 PM
absinth
 
Posts: n/a
Default Compiling Pro*C Flatten.pc For Spooling

Hi,

I've got flatten.pc off:

asktom.oracle.com/~tkyte

which spools a table and I'm trying to compile it.

I successfully executed proc -iname=flatten flatten.pc and have the
resulting '.c' file. Now when I try compile it with:

gcc -o flatten flatten.o -m64 -L/oracle/rdbms/9.2.0/orax011/lib
-lclntsh -m64 -lclntst9 -m64

+ gcc -o flatten flatten.o -m64 -L/oracle/rdbms/9.2.0/orax011/lib
-lclntsh -m64 -lclntst9 -m64

ld: fatal: file flatten.o: wrong ELF class: ELFCLASS32

ld: fatal: File processing errors. No output written to flatten

collect2: ld returned 1 exit status

I can't get out the binary?


I've tried to use Tom Kyte's Oracle Pro*C makefile
(http://asktom.oracle.com/~tkyte/proc_makefile/) also to no avail. Can
anyone give me some pointers or an example make file?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-24-2008, 12:24 PM
Thomas Kyte
 
Posts: n/a
Default Re: Compiling Pro*C Flatten.pc For Spooling

In article <1112741982.663514.248260@o13g2000cwo.googlegroups .com>, absinth
says...
>
>Hi,
>
>I've got flatten.pc off:



what OS
what db release?


>
>asktom.oracle.com/~tkyte
>
>which spools a table and I'm trying to compile it.
>
>I successfully executed proc -iname=flatten flatten.pc and have the
>resulting '.c' file. Now when I try compile it with:
>
>gcc -o flatten flatten.o -m64 -L/oracle/rdbms/9.2.0/orax011/lib
>-lclntsh -m64 -lclntst9 -m64
>
>+ gcc -o flatten flatten.o -m64 -L/oracle/rdbms/9.2.0/orax011/lib
>-lclntsh -m64 -lclntst9 -m64
>
>ld: fatal: file flatten.o: wrong ELF class: ELFCLASS32
>
>ld: fatal: File processing errors. No output written to flatten
>
>collect2: ld returned 1 exit status
>
>I can't get out the binary?
>
>
>I've tried to use Tom Kyte's Oracle Pro*C makefile
>(http://asktom.oracle.com/~tkyte/proc_makefile/) also to no avail. Can
>anyone give me some pointers or an example make file?
>



--
Thomas Kyte
Oracle Public Sector
http://asktom.oracle.com/
opinions are my own and may not reflect those of Oracle Corporation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-24-2008, 12:25 PM
absinth
 
Posts: n/a
Default Re: Compiling Pro*C Flatten.pc For Spooling

Hi Tom,

I have to say asktom is one of the most awesome Oracle resources out
there. It's been a godsend at work...

1. Answer to Q1:
Solaris 9

Running on a Sun V440

2. Answer to Q2:
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-24-2008, 12:25 PM
Frank Langelage
 
Posts: n/a
Default Re: Compiling Pro*C Flatten.pc For Spooling

absinth wrote:
> Hi,
>
> I've got flatten.pc off:
>
> asktom.oracle.com/~tkyte
>
> which spools a table and I'm trying to compile it.
>
> I successfully executed proc -iname=flatten flatten.pc and have the
> resulting '.c' file. Now when I try compile it with:


Where is the compilation command line (gcc -c ...).
The following line is the link command.

> gcc -o flatten flatten.o -m64 -L/oracle/rdbms/9.2.0/orax011/lib
> -lclntsh -m64 -lclntst9 -m64
>
> + gcc -o flatten flatten.o -m64 -L/oracle/rdbms/9.2.0/orax011/lib
> -lclntsh -m64 -lclntst9 -m64
>
> ld: fatal: file flatten.o: wrong ELF class: ELFCLASS32
>


You have to use -m64 also for the compilation step so that you get a
64bit object file flatten.o or compile and link in 32bit mode by
avoiding the m64 switch and use $ORACLE_HOME/lib32 as lib dir.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-24-2008, 12:26 PM
absinth
 
Posts: n/a
Default Re: Compiling Pro*C Flatten.pc For Spooling

Thanks so much to Frank and Tom.

I managed to get it working with $ORACLE_HOME/lib32
gcc -O3 flatten.c -L/oracle/rdbms/9.2.0/orax011/*lib32 -lclntsh -m64
-lclntst9 -m64

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com