Integrate Pro * C/C ++ to the Visual C ++ Environment

Source: Internet
Author: User
This article describes how to integrate pro * C/C ++ into the Microsoft Visual C ++ 5.0 development environment. Includes the following:

  • Add Pro * C/C ++ to the Tools menu list.
  • Specify the file path.
  • Create a project file.

Add Pro * C/C ++ to the Tools menu list

After adding Pro * C/C ++ to the Tools menu list, we can directly use the Pro * C/C ++ pre-compiler in Visual C ++ 5.0. The following describes how to add Pro * C/C ++ to the Tools menu list:
Run Microsoft Visual C ++ 5.0. The following window is displayed:

Click the "Tools" menu and the following window appears:

Select the Customize menu item. The following dialog box is displayed:

Click the "Tools" page in the dialog box. The following dialog box is displayed:

Move the "menu contents" box to the bottom area. The dialog box is as follows:

Double-click the area of the dotted line rectangle. the dialog box is as follows:

Enter "Pro * C/C ++ 8.0" in the blank area and press Enter. the dialog box is as follows:

In the "command" box, enter the executable file name. For example:
D:/orawin95/bin/procui80.exe

In the "arguments" box, enter "$ (targetname )". When Pro * C/C ++ 8.0 is selected from the Tools menu, Visual C ++ passes the current project name to pro * C/C ++. Then, Pro * C/C ++ will directly open the file with the same name as. Pre under the file directory of the project.
In the initial directory box, enter $ (wkspdir )". The "mimize" dialog box is as follows:

Click Close ".

After completing the preceding steps, add Pro * C/C ++ 8.0 to the Tools menu list, then we can directly run the Pro * C/C ++ pre-compiler in Microsoft Visual C ++ 5.0.
Specify file path

To enable visual C ++ to directly run Pro * C/C ++, we must set the path of the execution file of Pro * C/C ++. If Microsoft Visual C ++ has been installed before installing Oracle 8.0, you must add the path of the Pro * C/C ++ execution file to the Visual C ++ environment. In addition, to enable visual C ++ to find the header file of Pro * C/C ++ during file compilation, we must also set the path of the header file of Pro * C/C ++.

Specify the path of the execution File

The following describes how to specify the path of the execution file:
Select a menu item "options" from the "Tools" menu. The following dialog box is displayed:

Click the "directories" page. The dialog box is as follows:

Select "executable files" from the "show directories for" list box. The following dialog box is displayed:

Move the "directories" box to the bottom area and double-click the dot-line rectangle area. The following dialog box is displayed:

Enter the ORACLE_HOME/bin directory in the blank area, for example:
D:/orawin95/bin
Click OK ".
In this way, the Directory D:/orawin95/bin is added to the execution file path of Visual C ++.
Specify the header file path
Follow these steps to specify the path of the header file:
Select Options from the Tools menu. The "options" dialog box is displayed.
Click the directories page in the dialog box.
Select "include files" from the "show directories for" list box ".
Move the scroll bar of the directories box to the bottom area.
Click the rectangular area of the dashes and enter the ORACLE_HOME/pro80/C/include directory. For example:
D:/orawin95/pro80/C/include
Click OK ".
In this way, the Directory D:/orawin95/pro80/C/include is added to the path of the Visual C ++ header file.
Create a project file
After adding the execution file path and header file path, we can create and generate a pro * C/C ++ application. The following example shows how to create and generate a console application. The procedure is as follows:
Run Microsoft Visual C ++ 5.0 and click the "file" menu. The following window is displayed:

Click "new" from the "file" drop-down menu. The following dialog box is displayed:

On the projects page, select "Win32 console application" and enter the directory of the project file in "location", for example, D:/example; enter the project file name in "project name", for example, exam01. The dialog box is shown in:

Click OK. The following window is displayed:

So far, the console application framework has been established. After the application framework is created, we must add the pre-compiled C or CPP file and the sqllib Runtime Library file to the console application.
Select "add to project" from the project menu, and then select "Files ". The following dialog box is displayed:

Enter the. c file in the "file name" box, for example, exam01.c. Click OK ". Because the. c file does not exist at this time, the "the specified file does not exist. Do you want to add a reference to the project anyway? ".
Click "yes" to add the. c file to the project file.
Add the sqllib80.lib file to the project file in the same way. The directory of the file is ORACLE_HOME/pro80/lib/msvc, for example, D:/orawin95/pro80/lib/msvc/sqllib80.lib. In other cases, you may need to add ora803.lib to the project file.
So far, all the project files have been created. Then, after pre-editing the. PC file into a. C or. cpp file, we can compile and link the application.
The above describes how to create and generate an application. In addition, we can also integrate all pro * C/C ++ into the visual C ++ project file, and then automatically pre-compile the project file during compilation. PC file, and all pre-compilation errors and warning information will be displayed in Visual C ++. Below are the steps to integrate all pro * C/C ++ into the project file:
Right-click the project file and the page appears, as shown in the following figure:

Select "add files to project" from the pop-up menu. The following dialog box is displayed:

Select the. PC file to be added, for example, exam01.pc, and click "OK ". In this way, we will add the. PC file to the project file.
Right-click the. PC file in "File View" and select "Settings" from the pop-up menu. The following dialog box is displayed:

In the "build command (s)" area, enter:
$ (Projdir)/.../../bin/proc $ (projdir)/$ (inputname). PC
Include = $ (projdir)/.../. Include include = "$ (msdevdir)/../VC/include"
For example:
D:/orawin95/bin/proc D:/sample/exam01/exam01.pc
Include = D:/orawin95/pro80/C/include = D:/vc5/VC/include parse = full
In the "output files" area, enter:
$ (Projdir)/$ (inputname). C (generate the. c file)
$ (Projdir)/$ (inputname). cpp (generate a. cpp file)
For example:
D:/sample/exam01/exam01.c
Click OK ".
In this way, the Pro * C/C ++ application will be automatically pre-compiled when the project file is compiled.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.