Integrate Pro * C/C ++ in VC ++ Development Environment)

Source: Internet
Author: User
The content discussed in this article is based on the following environment:
Microsoft Visual C ++ 6.0
Oracle 8i (8.1.7)

Current version: 1.0 (041221)

Disclaimer: some operations described in this article may have a major impact on the system. Please proceed with caution! I am not responsible for any consequences!

Integrate Pro * C/C ++ in the VC ++ Development Environment

Pro * C/C ++ provides great convenience for C/C ++ to access the Oracle database. However, during compilation, you often need to compile PC files in the nameline mode, at present, most of the development is completed in the integrated development environment such as VC ++. switching between the two is not only troublesome but also inconvenient for debugging.

In VC ++, the "Custom compilation steps" settings are provided, so that we can define how to process PC files by ourselves. Here is a brief introduction:

First, make sure that you have installed oralce's Pro * C/C ++.

Then, run visual c ++ to open a project file (workspace). The custom compilation steps are only applicable to a specific project. Select "project"-> "Settings ...". Select which configuration to set and select "All configrations" to overwrite all configurations.

Select all projects, click the "linker" tab, and add orasql8.lib to the library list. (The file name varies with Oracle versions)

Click the "m build" tab and add the following content to the "commands" edit box:
Call vcvars32.bat
Proc INAME = "$ (inputdir)/$ (inputname ). PC "include =" % msvcdir %/include "include =" $ (msdevdir )/.. /vc98/include "code = CPP parse = partial

Here is an explanation:
Call vcvars32.bat
This is used to set the compiling environment of VC.
Proc INAME = "$ (inputdir)/$ (inputname ). PC "include =" % msvcdir %/include "include =" $ (msdevdir )/.. /vc98/include "code = CPP parse = partial

This is to directly call the compilation of Proc.ProgramFor compilation, $ (inputdir) and other VC will be replaced by themselves, which does not need to be manually processed. Note: It is best to enclose the parameter passed to proc with quotation marks. If there is space in it, it will be treated as another parameter. This error is very difficult to query.

Add the following content to outputs:
$ (Inputdir)/$ (inputname). cpp
This is to tell VC which file is finally generated so that it can be used.

Click "OK" to save the file. In this way, you can directly edit the Pro * C file in VC ++.

In addition, you can click the PC file to set custom compilation steps in property settings.

Related Article

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.