Studio 2005 C++ Project Settings

来源:互联网 发布:事件视界 知乎 编辑:程序博客网 时间:2024/06/09 21:03

http://www.steptools.com/support/stdev_docs/express/help/settings_vc8.html

 

Overview

To build an ST-Developer application, the C++ compiler must know where the header and library files are, and what libraries to link against. The sections below describe how to do this within Visual Studio 2005. The sample programs for each AP are also a great place to see how these are configured.

To make it easy to tell the C++ compiler where to find the ST-Developer header files and libraries, we use environment variables set by the ST-Developer installer. The ROSE_INCLUDE variable points to the header file directory, and the ROSE_LIB variable points to the library directory.

Finding Header Files

Tell the compiler to look for header files in two extra directories. The first is ROSE_INCLUDE for the base ST-Developer headers. The second is the directory under ROSE_INCLUDE for your specific schema, such as ROSE_INCLUDE/ap203lib for the AP203 library classes. Make sure that you use the correct directory for your schema! The include directory name is listed on the page for each schema.

Within Visual Studio, select your project in the Solution Explorer and bring up the project's Property Page dialog. We want to change the settings for both Debug and Release versions, so under the Configuration field, select "All Configurations".

Select the C/C++ category of properties and, pick the General options under that. In the Additional Include Directories property, add the comma separated list of ST-Developer include directories. To get the value of the environment variable, use the syntax $(ROSE_INCLUDE) as shown below:

Linking Against The Libraries

Next, you must tell the linker what library files to use and where to find them. All library files are in the directory pointed to by the ROSE_LIB environment variable.

Go to the project's Property Page dialog as described above. We want to change the settings for both Debug and Release versions, so under the Configuration field, select "All Configurations".

Select the Linker category of properties and, pick the General options under that. In the Additional Library Directories property, add the ST-Developer library directory. To get the value of the environment variable, use the syntax $(ROSE_LIB) as shown below:

You must link against at least two libraries. The first is the ROSE library rose.lib. The second is the library for your schema, such as ap203lib.lib for the AP203 library classes. Make sure that you use the correct library for your schema! The library name is listed on the page for each schema. If your program includes Part 28 XML support you should also add p28e2.lib to the list of libraries.

In the project's Property Page dialog, select the Linker category of properties and, pick the Input option under that. In the Additional Dependencies property, add the add the schema library and the ROSE library as shown below:

The ST-Developer Windows installation contains versions of the programming libraries for use with Visual C++ 2005 (VC8) with the /MD and /MT flags. It also contains separate versions that are link compatible with the older Visual C++ 6.0 compiler. The ROSE_LIB environment variable usually points the VC8 /MD version.

To build all of your projects against a different version, change the ROSE_LIB variable. To change the version for just one project, use the ROSE environment variable, which points to the root of the ST-Developer installation. You can then call out a library directory explicitly. Use one of the following:

  • $(ROSE)/lib/i86_win32_vc8_md (32bit version)
  • $(ROSE)/lib/i86_win32_vc8_mt (32bit version)

     

  • $(ROSE)/lib/x64_win64_vc8_md (64bit version)
  • $(ROSE)/lib/x64_win64_vc8_mt (64bit version)

Check the ST-Developer release notes and install directory for the available versions on other platforms.

 

原创粉丝点击