Nirvana C++ Environment Setup : Windows
Once Nirvana has been installed, the sample applications can be run from the "C++ Examples Command Prompt". The guide below explains how the Nirvana C++ environment can be set up for compiling and running the applications on a Windows 32-bit operating system.
The Nirvana C++ and POCO libraries can be found in the cplus\windows\lib directory. In order to run Nirvana C++ applications, the location of these libraries must be known to the system. There are several methods which can be used to achieve this:
-
By updating the PATH environment variable in the command prompt used to compile or run code:
C:\> set PATH=C:\Nirvana 5.0.xxxx\cplus\windows\lib;%PATH%
This will allow you to run applications in the current command prompt.
-
In order to update the PATH globally, you need to:
- Open System in the Control Panel.
- Expand the "Advanced" tab and click the button labelled "Environment Variables"
- In the new window, the Path variable is found in the "System Variables" section. Highlighting the variable and clicking "edit" will open another window.
-
In this new window you should append the location of the libraries to the beginning of the "variable value" section. The default location of the libraries is:
C:\Nirvana 5.0.xxxx\cplus\windows\lib;
where xxxx is the build number and 5.0 is the version number.
-
Another way to make the libraries globally available is to copy them into the Windows System32 folder located at:
C:\WINDOWS\System32
This directory is looked in by default for Runtime libraries.
Compiling the Sample Applications
Once the environment has been set up as described above, the sample applications can be built by either opening the application's project file in Microsoft Visual Studio or by running vcbuild. In order to use vcbuild, either run the Microsoft Visual Studio command prompt and ensure that the Nirvana environment is set up, or run vsvars32.bat in a command prompt:
C:\> "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
The environment will now be set up for running vcbuild. In order to compile an application, navigate to the application's directory and run:
C:\Nirvana 5.0.xxxx\cplus\examples\channeliterator> vcbuild
This will compile the application in a new folder called Release. To clean this directory so that the application can be recompiled, run:
C:\Nirvana 5.0.xxxx\cplus\examples\channeliterator> vcbuild /clean
After compilation the executable (.exe) will be present in a folder called Release found in the same directory as the source code for the application.
