VR-Link C# API Documentation
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
3.1 - Compiling and Linking a VR-Link Application

Table of Contents

This section describes the steps required to compile and link a VR-Link application using the provided libraries and build tools.

3.1.1 Prerequisites

To build a VR-Link application, you must tell the compiler where to find the VR-Link header files, and for HLA, the RTI header files.

Note
If you are not using a C++ linker to link, you must explicitly link with C++ system libraries such as libC.so.

3.1.1.1 Required Environment Variables

To successfully configure a VR-Link application, set the following environment variables:

3.1.2 Compiling

  1. Source Files: Include the necessary VR-Link header files in your source code.
  2. Compiler Settings:
    • Use a C++ compiler compatible with your platform.
    • Include the required DLLs on your PATH.
    • Define the C preprocessor definition: #define DT_USE_DLL 1

3.1.2.1 Supported Compilers

Supported compilers may vary by VR-Link version and platform. Please refer to the Release Notes or the MAK Product Specifications page ({https://www.mak.com/mak-one/support/help/specs/}{MAK Product Specifications}) to see which compilers are supported for your version of VR-Link.

On Windows, VR-Link supports the use of any Visual Studio IDE as long as the correct compiler is supported and used as detailed above. For Linux systems, VR-Link supports the compiler provided with the distribution.

Example (Windows, Visual Studio): ``` Include Directories:

Definitions: WIN32;_DEBUG;... ```

3.1.2.2 Compiling Under Windows

Under Windows, you can set your program's protocol following the procedures in this section. You need to provide build settings in Microsoft Visual Studio to define constants and specify paths for header files and RTI libraries.

VR-Link includes project files for DIS and the three HLA versions. If you are building for HLA, make sure to point to the correct location of the RTI include and library directories. The default is to use the value in the MAK_RTIDIR environment variable.

3.1.2.2.1 Compiling for a HLA Protocol

  1. Choose Project -> Properties, then select the C/C++ folder.
  2. Enter the following #define symbols in the space provided for preprocessor definitions:

    DtHLA=1, DtHLA_1516=1, DtHLA_1516_EVOLVED=1, DtHLA_4=1, RTI_USES_STD_FSTREAM=1

  3. In the C/C++ -> General section, in the space provided for additional include libraries, enter your VR-Link include path and the path to your RTI include directory, for example:

    ../../include, "c:/MAK/makRti4.6.1/include" or: /include, /include

    Note
    The relative pathnames in this procedure (for example, ../../include) are relative to the project .vcproj file in the ./examples/f18 directory of the default VR-Link installation. The full path would be similar to C:/MAK/VR-Link5.9/include.
  4. Select the Linker folder.
  5. In the Linker -> Input section, in the space provided for additional dependencies, enter the appropriate RTI, VR-Link and Visual C++ library files, for example:

    {libRTI-NG_64.lib | librti1516_64.lib | librti1516e64.lib | librti1516_2025vc141.lib} {libfedtime_64.lib | libfedtime1516_64.lib | libfedtime1516e64.lib | libfedtime1516_2025vc141.lib} vl.lib vlutil.lib mtl.lib matrix.lib {vlHLA13.lib | vlHLA1516.lib | vlHLA1516e.lib | vlHLA4.lib} WS2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib

  6. Also, make sure you list the appropriate paths to these files in the "Additional Library Directories" box in the Linker -> General section, for example:

    /lib64, /lib

3.1.2.2.2 Compiling for a DIS Protocol

  1. In the C/C++ -> General section, in the space provided for additional include libraries, enter your VR-Link include path, for example:

    ../../include

  2. In the Linker -> Input section, enter the appropriate VR-Link and Visual C++ library files, for example:

    vlutil.lib mtl.lib matrix.lib vl.lib vlDIS.lib WS2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib

  3. List the appropriate paths to these files in the "Additional Library Directories" box in the Linker -> General section, for example:

    ../../lib64

3.1.2.3 Compiling Under Linux

To build a VR-Link application for Linux using MAK's build system, you must use gcc. Supported versions include version 8.3 and version 11.

You can select DIS or HLA at compile time by using the flags described in the following sections. VLHOME represents your VR-Link home directory.

The order of the libraries in the link line is significant. For more information, please see the Makefiles in ./examples. Other flags may be required on some platforms. For more information, please see the example makefiles and release notes.

3.1.2.3.1 Compiling for a HLA Protocol

After you install VR-Link, create a symbolic link called RTI in the top-level VR-Link directory. Point the link to the RTI distribution that you are using.

Compile Flags:**

3.1.2.3.2 Compiling for a DIS Protocol

The compile and link flags for DIS are:

Compile Flags:**

3.1.3 Linking

  1. Library Files:
    • Link against the VR-Link libraries located in lib/ or lib64/ (depending on your target architecture).
    • Add any additional libraries required by your application (e.g., Qt, system libraries).
  2. Linker Settings:
    • Set the library path to the VR-Link lib/ or lib64 directory.
    • Specify the VR-Link library files. Common libraries include:
      • managedInterface
      • matrix
      • mtl
      • omtReader
      • strategies
      • tbb
      • vl
      • vlNetworkCompatibility
      • vlpi
      • vlutil
    • For protocol-specific builds link the appropriate variation of the vl library:
      • Windows:
        • vlDIS
        • vlHLA13
        • vlHLA1516
        • vlHLA1516e
        • vlHLA4
      • Linux:
        • libvlDIS.so
        • libvlHLA13.so
        • libvlHLA1516.so
        • libvlHLA1516e.so
        • libvlHLA4.so
  3. If you run into linking problems, add the following libraries to your link line:
    • kernel32.lib
    • user32.lib
    • gdi32.lib
    • winspool.lib
    • shell32.lib
    • ole32.lib
    • oleaut32.lib
    • uuid.lib
    • comdlg32.lib
    • advapi32.lib

3.1.4 Third-Party Libraries

VR-Link uses a number of third-party libraries such as libXml2, boost, and iconv. If you are building a VR-Link application, you must include these libraries on your link line.

See the VR-Link Getting Started Guide, located in your VR-Link install, for the correct version of third-party libraries to use with your version of VR-Link.

[Home] [Top of Page] [Using VR-Link from C >>]


Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)