Unix Technical Forum

Error Building the Pro*C Program

This is a discussion on Error Building the Pro*C Program within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi all, When I try to compile my Pro*C program am getting the following error.. cc -I/sample/ -I/orabin/server/oracle/product/9.2.0/rdbms/demo -I/orabin/server/oracle/product/9.2.0/rdbms/public ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 10:08 AM
jvramya@mickeyfan.com
 
Posts: n/a
Default Error Building the Pro*C Program

Hi all,

When I try to compile my Pro*C program am getting the following error..

cc -I/sample/ -I/orabin/server/oracle/product/9.2.0/rdbms/demo
-I/orabin/server/oracle/product/9.2.0/rdbms/public
-I/orabin/server/oracle/product/9.2.0/precomp/public -c -g -KPIC -w -c
sample.c; \

"sample.c", line 207: undefined symbol: EXEC
"sample.c", line 207: syntax error before or at: ORACLE
"sample.c", line 225: left operand of "." must be struct/union object
"sample.c", line 225: cannot recover from previous errors
cc: acomp failed for sample.c
*** Error code 2
make: Fatal error: Command failed for target `sample.o'

I have used the following in my sample.pc file:
typedef char asciz;

EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL TYPE asciz is string(20) ;

EXEC SQL END DECLARE SECTION;

Hope some of u would have already encountered this problem.. Any help
regarding this is much appreciated.. Let me know if you need any more
information...

Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 10:08 AM
Laurenz Albe
 
Posts: n/a
Default Re: Error Building the Pro*C Program

jvramya@mickeyfan.com wrote:
> When I try to compile my Pro*C program am getting the following error..
>
> cc -I/sample/ -I/orabin/server/oracle/product/9.2.0/rdbms/demo
> -I/orabin/server/oracle/product/9.2.0/rdbms/public
> -I/orabin/server/oracle/product/9.2.0/precomp/public -c -g -KPIC -w -c
> sample.c; \
>
> "sample.c", line 207: undefined symbol: EXEC
> "sample.c", line 207: syntax error before or at: ORACLE


Could you post line 207 of sample.c?

Yours,
Laurenz Albe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 10:08 AM
jvramya@mickeyfan.com
 
Posts: n/a
Default Re: Error Building the Pro*C Program

EXEC ORACLE OPTION (MAXOPENCURSORS=2);
EXEC ORACLE OPTION (ORACA=YES);

These are the codes that throws error.I feel i miss something in
makefile to fulfill these oracle specific declarations.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 10:08 AM
Alain Deschamps
 
Posts: n/a
Default Re: Error Building the Pro*C Program

On 27 Mar 2006 01:02:56 -0800, jvramya@mickeyfan.com wrote:

>EXEC ORACLE OPTION (MAXOPENCURSORS=2);
>EXEC ORACLE OPTION (ORACA=YES);
>
>These are the codes that throws error.I feel i miss something in
>makefile to fulfill these oracle specific declarations.


You need to use the Pro*C preprocessor to convert the file to proper C
code before using the C compiler, check the Pro*C documentation.
--
echo papxc.sthrwpbeh@ugtt.ug | tr "p-za-o" "a-z"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2008, 10:08 AM
=?iso-8859-1?Q?St=E9phane?= GASSIES
 
Posts: n/a
Default Re: Error Building the Pro*C Program

....
> cc -I/sample/ -I/orabin/server/oracle/product/9.2.0/rdbms/demo
> -I/orabin/server/oracle/product/9.2.0/rdbms/public
> -I/orabin/server/oracle/product/9.2.0/precomp/public -c -g -KPIC -w -c
> sample.c; \


....
> I have used the following in my sample.pc file:
> typedef char asciz;
>
> EXEC SQL BEGIN DECLARE SECTION;
> EXEC SQL TYPE asciz is string(20) ;
>
> EXEC SQL END DECLARE SECTION;

Your code is pro*c code, no "C" code.
You need to preprocess it with proc precompiler.

Generally, "pro*c" code is by convention named *.pc.
You sould look at Oracle makefiles
e.g. (without options)
proc mycode.pc > mycode.c
cc mycode.c -o mycode "oracle options to add"

Regards,
Stephane
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 11:06 AM.


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