.. _env_drcf_version: 1.3.2 DRCF Version Compatibility -------------------------------- The DRFL headers require C++11 or later and cannot be compiled as C. To use DRFL from C, write a small C++ wrapper with ``extern "C"`` functions. The underscore-prefixed functions take a handle: the TCP functions use the handle from _CreateRobotControl (released with _DestroyRobotControl), and the RT functions use the handle from _create_robot_control_udp (released with _destroy_robot_control_udp). CDRFLEx creates both handles. Some functions may have different interface usage depending on the controller version. Set **DRCF_VERSION** to 2 or 3 according to the controller version. DRCF_VERSION must have the same value in every source file that includes the DRFL header. Set it once for the whole project as a compiler definition (for example ``-DDRCF_VERSION=2`` or ``target_compile_definitions( PRIVATE DRCF_VERSION=2)``) rather than with ``#define`` in individual files. If DRCF_VERSION is not defined, DRFLEx.h uses 3. .. code-block:: cpp :linenos: :caption: Example of including and initializing DRFLEx in C++ // DRCF_VERSION is set as a compiler definition, for example -DDRCF_VERSION=3 #include "../../include/DRFLEx.h" #include "util.hpp" const std::string IP_ADDRESS = "192.168.137.100"; using namespace DRAFramework; CDRFLEx robot; bool g_bHasControlAuthority = FALSE; bool g_TpInitailizingComplted = FALSE; bool control_authority_granted = FALSE;