Solved

Precompiling C++ with embedded PL/SQL code

Posted on 2001-07-09
13
402 Views
Last Modified: 2012-08-13
I am using Pro*C/C++ Programmer to precompile some C++ code with embedded SQL statements.  My header files are both C++ and Oracle.  I set up my INCLUDE= precompiler option path to the Oracle header files.  This path precompiles OK.  The C++ header files, like #include <iostream.h> and others will not precompile.  I set up my SYSTEM_INCLUDE precompiler option as (c:\program files\microsoft visual studio\vc98\include}. Each time I attempt to precompile, I get an error message like "file cannot be found or illegal or out of range command. The error code is PCC-5-02015.  Am I setting up my precompiler options properly?  I need help!
0
Comment
Question by:fredsawyer
  • 5
  • 5
  • 3
13 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 6266165
Are you sure that you have files like <iostream.h>?  All the standard STL files are extenionless, like <iostream>.  The ones with extensions are non-standard and many copmpilers won't provide them....
0
 

Author Comment

by:fredsawyer
ID: 6266283
nietod,
I just followed my path to the MS VB98 Include file and found iostream.h and many other header files with the .h extension. I even took the .h extensions off of the C++ header files and I still got precompile error messages.  Any more suggestions?
0
 
LVL 22

Expert Comment

by:nietod
ID: 6266392
What compiler is this for?

What do you mena by "pre-compile"   Note that most of the contents of STL headers, like <iostream> are templates and there probably are limiations to how much precompilation can be done on them.  i.e. they can be expanded in different ways for different template parameters, so there are limits to what can be done "ahead of time".   But all this depends on the compiler and what "pre-compile" means in this context.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:Axter
ID: 6266504
>>I set up my SYSTEM_INCLUDE precompiler option as
>>(c:\program files\microsoft visual studio\vc98\include}.

Did you try using the short name version.  Some programs can't take long file/directory names.


0
 
LVL 30

Accepted Solution

by:
Axter earned 50 total points
ID: 6266513
You also might want to try using "" double quotes around it.
Could you post what you use as a directory for Oracle?
0
 

Author Comment

by:fredsawyer
ID: 6266523
Oracle sells some SW called Pro*C/C++ Precompiler. This SW allows SQL or PL/SQL code to be embedded in a C++ host program.  Once you write the host C++ program with the embedded SQL statements, the host program must be precompiled by the precompiler so that it will contain the necessary "hooks and handles" for regular C++ compiling.  This allows one to transfer data from a host array into an Oracle table, for example.  By the way, this is what I am really trying to do, among other things.
0
 
LVL 22

Expert Comment

by:nietod
ID: 6266534
Can the pre-compiler handle templates.  the <iostream> file containes templates and that might be too much for it to handle.

You could test this by writting a simple program that just has a single template (that you write) in it.
0
 
LVL 30

Expert Comment

by:Axter
ID: 6266536
Did you try my suggestions?
0
 

Author Comment

by:fredsawyer
ID: 6266584
Axter,
Here is the path to my Oracle header files:
d:\oracle\ora81\precomp\public

Oracle header files like #include <oraca.h> and #include <stdio.h> all precompiled OK. But not the C++ header files!
0
 
LVL 30

Expert Comment

by:Axter
ID: 6266720
>>d:\oracle\ora81\precomp\public

The orcale header file is using short names.
Try using the short name version of the pathed for the standard C++ header files.

Do you understand what I mean by short-name?
0
 
LVL 30

Expert Comment

by:Axter
ID: 6266736
What OS are you using? NT/98/2000
0
 

Author Comment

by:fredsawyer
ID: 6266901
Axter,
Just got out of a long meeting. Got all of your suggestions and will try them tonight. Am on the east coast. Will give U the results in the AM, your time.
P.S. Using OS 98!
0
 

Author Comment

by:fredsawyer
ID: 6270633
Axter,
It worked!  I put double quotes around the path to the C++ header files and the precompiler worked fine!  Thanks!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question