- A C++ compiler. I will use an IDE (Microsoft Visual Studio 2005).
- PVSS
- the PVSS C++ API.
You will want to create an environment variable pointing to this location, unless there is one already. I've had PVSS installed for so long on my system that I don't remember anymore if I really created the environment variable, or it came with the installation. Create a variable named "API_ROOT" and make it point to your api folder:
Next, you need to make the headers and libraries known to your compiler. For Visual Studio 2005, complete the following steps. Create a new project (Win32 Project), give it a name (like ExampleExt, actually I will use the ExampleExt for the remaining of this tutorial), select to make it a DLL, and I would also recommend making it an empty project. I will assume that all source files will be stored in a "src" sub-folder, and that all header files will be in an "include" sub-folder. Then go to the properties for the project (right click -> go to "Properties") and add the API additional include directories. This will be under "Configuration Properties" -> "C/C++" -> "General". It should look similar to the following picture:
Next go to the Linker dependencies ("Configuration Properties" -> "Linker" -> "Input") and add all required libraries. For our example, only 3 are needed: libManager.lib, libBasics.lib, libCtrl.lib. Do the same for all build configurations. The image may only show the Debug configuration, but the same should be done for Release as well (or simply select "All Configurations" and do the configuration just once). The window should look similar to the following picture:
Also configure the "Output Directory" and "Intermediate Directory" to be ".\build" instead of the default "$(SolutionDir)$(ConfigurationName)". You can configure these under "Configuration Properties" -> "General". You may want to configure the output file as well. Go to "Configuration Properties" -> "Linker" -> "General" and set the "Output File" to ".\build\ExampleExt.dll".
And one more miscellaneous operation will be to define the PVSS version to use the DLL from. For this, a preprocessor definition should be done. Go to "Configuration Properties" -> "C/C++" -> "Preprocessor" and at "Preprocessor Definitions" add one entry after all the existing ones:
- PVSS_VERS_DLL=\"308000.319\"
That's the basic C++ side of the configuration.
No comments:
Post a Comment