ANSI C Based OPC UA Client/Server/PubSub SDK
Generating Project Files for Visual Studio

This pages describes how to create project files for Visual Studio 2008 and higher for the SDK and the examples using CMake.

Generate SDK Projects

Start the CMake GUI as administrator. Click on “Browse Source…” and select the “src” directory below the SDK installation directory (see screenshot).


Select the build folder, i.e. the folder to save generated projects to. Click on “Browse Build…” and pick a folder of your choice. For this example, we’re using “vs2015”, because we’re generating projects for Visual Studio 2015.


Then click on “Configure”. A dialog window will open. Choose your compiler from the drop-down list (see screenshot). We’re picking “Visual Studio 14 2015 Win64”.


If all the settings are to your liking, press “Generate”. If you’ve changed anything, it’s necessary to click on “Configure” again before generating. When finished, the generated project files can be found in the build folder specified above.


Build the SDK with Visual Studio

To build the SDK, open the solution file generated above in Visual Studio. In our case, it’s called uasdkc_src.sln, because we were using the ANSI C SDK for this example. The name differs depending on the product.

“ALL_BUILD” is already set as start-up project, so you can simply build the solution. When finished, build “INSTALL”.


After a successful build, the result can be found in the folder specified at “CMAKE_INSTALL_PREFIX” above, in our case “C:/Program Files/uasdkc_src”, which is the default for the ANSI C SDK.


Generate Example Projects

Generating projects for the examples delivered with the SDK is quite similar to generating SDK projects. We have to pick the source directory and the build directory first.

As source directory, choose the folder “examples” below the SDK installation directory. As build directory, pick a folder of your choice. We’ve created a subdirectory “vs2015examples” of the SDK installation directory.


Then click on “Configure” and pick your compiler from the drop-down list (see above).

Before generating the projects, we have to change “CMAKE_INSTALL_PREFIX”. Pick the same directory as set for the SDK, in this case “C:/Program Files/uasdkc_src” (see above).


Click on “Configure” again, then on “Generate”. When finished, the project files can be found in the build folder.


Now open the sln file in Visual Studio. Build the solution, then build “INSTALL”. When finished, the binaries can be found in the subfolder “bin” of the folder specified at “CMAKE_INSTALL_PREFIX”.