Solved

Precompiling C++ with embedded PL/SQL code

Posted on 2001-07-09
13
393 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 30

Expert Comment

by:Axter
Comment Utility
>>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
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 22

Expert Comment

by:nietod
Comment Utility
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
Comment Utility
Did you try my suggestions?
0
 

Author Comment

by:fredsawyer
Comment Utility
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
Comment Utility
>>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
Comment Utility
What OS are you using? NT/98/2000
0
 

Author Comment

by:fredsawyer
Comment Utility
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
Comment Utility
Axter,
It worked!  I put double quotes around the path to the C++ header files and the precompiler worked fine!  Thanks!!!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now