VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
How To Build Examples

Table of Contents

Introduction

The examples are pre-compiled and installed by the SDK installer so it is not necessary to build them in order to try them out. To activate the pre-built plug-ins, please see section "4.8.1. Loading Plug-ins", in VR-Forces Users Guide.

Prerequisites

Before you can build an example or a custom application, you must install the supporting software that your installation depends on and you must configure environment variables, so that the example project files can find these prerequisites. Using Windows you must go to System Properties and edit the Environment Variables or open a console to edit them locally there using "set". On Linux you can use a console and use the command "export" to set your environment variables.

You must do the following:

Building the VR-Forces Examples

To build VR-Forces examples in Windows, simply open the project file of the example you wish to use and build it. When building on Linux you must first run cmake (see below for generation of project files and Makefiles). Once the Makefile generation (CMake) has finished on Linux, you can run "make" in the VR-Forces install's main directory. The newly built DLL or shared object will automatically be copied to the "build" directory where it can be loaded via the Plug-in management interface documented in Managing Plug-ins in VR-Forces Users Guide. Stand-alone executables will automatically be copied into the "bin" directory.

Debugging VR-Forces Examples

VR-Forces does not include debug DLLs on Windows systems. This is done because the debug versions of the VRF DLLs run so slowly that it is not practical to run the debug version of the application, and it is possible to effectively debug applications using release mode DLLs if built correctly.

On Windows, it is required to link debug DLLs with other debug DLLs, which means that it is not possible to create a VRF plugin built in debug mode.

The best way to debug plugins for VR-Forces is to build in the “RelWithDebInfo” configuration and to turn off optimizations for the plugin modules being debugged. This allows the Visual Studio environment to break on specific lines, step through code, and show variable values, all while using a release build of the plugin, and linking against the release version DLLs of VR-Forces.

Generating Project/Makefile Files

You can use the CMAKE program (found at cmake.org) to regenerate distributed project examples or to generate your own project from a CMakeLists.txt file.

In order to generate project files using cmake you will need to have at least version 3.24 of cmake installed on your system. You will then need to open a shell window and change your directory to your VR-Forces install's main directory. You can use cmake –help to see what compilers are available. You can then choose your compiler to build your project files.

For example, if you wish to generate a Windows VC15 2017 set of project files you would execute the following command:

cmake -G "Visual Studio 15 2017 Win64"

This will regenerate all project files and incorporate any changes you may have made and create a vrforcesExamples_64.sln solution. You can use Visual studio to open and build the projects.

To generate Linux Makefiles, you must have CMake installed and run the following command in the VR-Forces install's main directory.

cmake -G "Unix Makefiles" .

This will regenerate all Makefile files and incorporate any changes you have made. You can run "make" in the in the VR-Forces install's main directory.

CMake will also automatically generate the necessary moc or uic statements for additional Qt sources.

You may create your own example project by copying one of the existing projects and modifying the CMakeLists.txt file to subsitute in your project name. Once created you will need to add your example to the CMakeLists.txt file in the examples directory in the appropriate protocol or non-protocol section.


Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)