Home » Developer & Programmer » Precompilers, OCI & OCCI » Pro*c Include File
Pro*c Include File [message #94230] Thu, 27 May 2004 22:38 Go to next message
Kaustubh Deshpande
Messages: 32
Registered: March 2004
Member
In c , general practice is , we create header file (.h)which will have declaration of functions. One more file which will have actual body of those functions.
And in main file we include that header file, we never include the file in which actual body is written. As we will not give our client code of those functions.

The same thing , I am trying to do in pro*c, but couldn't succeed, Linking Error comes and exe is not generated.

Could any one tell me the way to do it ?

Regards,
Kaustubh
Re: Pro*c Include File [message #94275 is a reply to message #94230] Mon, 28 June 2004 21:17 Go to previous message
Jai Vrat Singh
Messages: 205
Registered: September 2002
Location: Singapore
Senior Member
if you header file as myheader.h

and you main program ( or .pc file) is process.pc ( say .)

then inside process.pc use

EXEC SQL INCLUDE myheader.h;

instead of

#include "myheader.h"

Then precompiler wil take care of that to include its contents before anything.
You get error because C preprocessor does its job after the oracle precompiler.

Hence above substitution will work.

Cheers,
Jai Vrat
Previous Topic: SQL select and C
Next Topic: OCIStmtFetch error handling
Goto Forum:
  


Current Time: Fri Apr 19 01:17:31 CDT 2024