Visual Studio SLN

On windows, CMake is used to generate a SLN and associated project files.

> mkdir build
> cd build
> cmake .. <options>

Once you've generated your SLN, you can just open it and use Visual Studio to build the project for you just like any other project.

Command Line

Alternatively, you can just invoke msbuild.exe on the generated solution and build from the command line.

> msbuild opendnp3.sln

Installing

CMake creates a special project called "install" that you can run inside Visual Studio to install the headers and libraries to the directory specified by CMAKE_INSTALL_PREFIX.

TLS Support

If you need to build the stack w/ TLS support (or you're using the .NET bindings), then you need to install openssl on Windows. Use the installers from ShiningLight.

.NET Bindings

By far, the easiest way to use the .NET bindings is just to install the Nuget package we publish:

PM> Install-Package opendnp3

or to allow pre-release versions:

PM> Install-Package opendnp3 -Pre

Manually building

Building the .NET bindings requires linking to openssl. As a result, you need to create and install an opendnp3 build with -DFULL=ON set when creating the SLN.

The .NET bindings use a separate SLN located in the 'dotnet' folder (bindings.sln). They treat the C++ libraries as if they were a dependency. There are a few environment variables you need to define so that the SLN can find opendnp3.

Using the "static" directory of the openssl distribution will create .NET bindings that statically link all of openssl. If you'd prefer to link dynamically use the "lib/VC" directory instead.

You don't need to define both the 32/64 bit library locations. Just define what you plan on building.