This directory contains C++ example projects for MSCL.
- MSCL Library: You must have MSCL built or installed on your system.
- Boost: MSCL depends on Boost (recommended 1.70.0 or newer).
- OpenSSL: MSCL depends on OpenSSL. (Required if
MSCL_WITH_SSLis enabled)
The examples are set up to be built using CMake. You can build them as part of the main MSCL project or as standalone projects. The main difference is the options used to configure the project
Set the MSCL installation root directory using MSCL_ROOT_DIR:
cmake -S . -B build -DMSCL_ROOT_DIR="C:/path/to/mscl/install"cmake -S . -B build -DCMAKE_BUILD_TYPE:STRING=Release -DMSCL_ROOT_DIR="/path/to/mscl/install"Enable the examples using MSCL_BUILD_CPP_EXAMPLES:
cmake -S . -B build -DMSCL_BUILD_CPP_EXAMPLES:BOOL=ONcmake -S . -B build -DCMAKE_BUILD_TYPE:STRING=Release -DMSCL_BUILD_CPP_EXAMPLES:BOOL=ONBuild the C++ example targets:
MSCL-Cpp-Displacement-Example: The displacement example.MSCL-Cpp-Inertial-Example: The inertial example.MSCL-Cpp-Wireless-Example: The wireless example.
cmake --build build --config Release --target MSCL-Cpp-Wireless-Example --parallel $env:NUMBER_OF_PROCESSORScmake --build build --target MSCL-Cpp-Wireless-Example --parallel $(nproc)If you prefer not to use CMake, you can manually configure your project
- Include Directories:
- Add the path to MSCL headers (e.g.,
MSCL/include). - Add the path to Boost headers.
- Add the path to OpenSSL headers. (if
MSCL_WITH_SSLis defined)
- Add the path to MSCL headers (e.g.,
- Linker Dependencies:
- Link against
MSCL. - Link against required Boost libraries (e.g.,
libboost_system). - Link against OpenSSL libraries (
libssl,libcrypto).
- Link against
- Compiler Options:
- Define
MSCL_WITH_SSLto enable SSL support - Define
MSCL_WITH_WEBSOCKETSto enable websocket support
- Define
- Precompiled Headers:
- MSCL headers often require
mscl/stdafx.hto be included first, or use it as a precompiled header.
- MSCL headers often require