tags:

views:

223

answers:

4

How do you get Pro*c to work within MSVC 6?

In otherwords compile a .pc file into a .cpp file.

A: 

Visual C++/Visual Studio won't be a big help other than being an editor, but you should be able to get this to work with a Makefile project.

Michael Burr
A: 

You can do it (unfortunatley I'm not going to be much help as it has been many years since I last used VC6.) According to my failing memory, we set up the file type '.pc' (in the tools section of VC?) so that VC knew to call proC to generate a .c or .cpp version of the file.
I believe we included both the (source) .pc and (generated) .cpp file in the project (there is probably a better way to do this) so that we could easily edit the proC file in VC.
(I can't remember how we told VC that the cpp file was dependent on the pc file)
Best of luck.

hamishmcn
+1  A: 

I'm not familiar with Pro*C, but in general it is possible, using a custom build step in MSVC. If you add the .pc file to your project, then view the Project Settings dialog for that file, on the Custom Build tab you can specify the command(s) needed to compile the .pc file to .cpp. You should also enter the name of the output .cpp in the Output section, so that the build system understands the file dependencies, and add the output .cpp to your project, of course.

ChrisN
Yes. this did the trick.Thank you very much.
EvilTeach
A: 

In the custom build tab for the .pc file.

I pop this in the outputs. The output of proc, is a cpp file

$(ProjDir)\$(InputName).cpp

There are 2 lines in the commands window. One to set the MSVC 6 environment. The other to invoke proc on the .pc file.

call vcvars32.bat 
proc sqlcheck=semantics userid=scott/tiger@instance   code=cpp char_map=string   sqlcheck=semantics parse=partial mode=ansi    $(ProjDir)\$(InputName).pc    include=c:\ora920\oci\include   include="%MSVCDIR%\include" include="$(MSDEVDIR)\..\vc\include"      include="$(MSDEVDIR)\..\..\vc98\include"

You must add the .cpp file to your project in order to compile it. If you need to debug, set your breakpoints in the .cpp file.

That pretty much covers it.

EvilTeach