Overview
Visual Studio 2005 and 2008 are no longer supported as of v17 and later of the STEP Tools® software.
To build a STEP Tools® software 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 and 2008. 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 STEP Tools® software header files and libraries, we use environment variables set by the STEP Tools® software installer. The ROSE variable points to the STEP Tools® software install directory, ROSE_INCLUDE points to the header file directory, and ROSE_LIB points to a preferred 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 STEP Tools® software 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, right click on your project in the Solution Explorer and bring up the project's Properties 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 semicolon-separated list of STEP Tools® software include directories. To get the value of the environment variable, use the syntax $(ROSE_INCLUDE) as shown below:
Linking To Static Libraries
Next, you must tell the linker what library files to use. We want to change the settings for both Debug and Release versions, so in the project Properties dialog, under the Configuration field, select "All Configurations".
Select the Linker category of properties and, pick the Input option under that. In the Additional Dependencies property, add the library for your schema, such as ap203lib.lib for the AP203 library classes. The correct library name is listed on the documentation page for each schema. Next, add the ROSE library rose.lib. If your program needs Part 28 XML support you must also add rosexml.lib to the list of libraries. Finally, add the advapi32.lib system library, which is needed for registry functions.
Finally, you must tell the linker where to find the library files. The STEP Tools® software Windows installation contains programming libraries built for use with Visual C++ 2005 (VC8) and 2008 (VC9) with the /MD flag, as well as versions that are link compatible with other compilers. These are kept in different subdirectories under the STEP Tools® software "lib" directory. The library directories available for Visual Studio 2005 and 2008 are as follows:
- $(ROSE)/lib/i86_win32_vc8_md (2005, 32bit platform, /MD)
- $(ROSE)/lib/x64_win64_vc8_md (2005, 64bit platform, /MD)
- $(ROSE)/lib/i86_win32_vc9_md (2008, 32bit platform, /MD)
- $(ROSE)/lib/x64_win64_vc9_md (2008, 64bit platform, /MD)
Select the Linker category of properties and, pick the General options under that. In the Additional Library Directories property, add the appropriate STEP Tools® software library directory.
Instead of an explicit subdirectory, you may use the ROSE_LIB environment variable to substitute a preferred library directory. If this variable points to a different configuration, manually change it to one of the ones above.