Library Setup <C++ Linux>
This section provides instructions on building the SDK.
Install requirements
- The DYNAMIXEL SDK requires GNU gcc ver. 5.4.0 20160609 or higher
- To check the version of your gcc compiler
$ gcc -v - Download the requirements
$ sudo apt-get install gcc $ sudo apt-get install build-essential $ sudo apt-get install gcc-multilib g++-multilib # For cross-compiling
Build the SDK
- Check your system architecture
$ uname -m - Enter the appropriate build folder depending on your system and build the SDK
$ cd DynamixelSDK/c++/build/linux64 # for 64-bit systems $ sudo make install - make sure to enter the correct folder according to your system architecture.
linux64for 64-bit systemslinux32for 32-bit systemslinux_sbcfor ARM-based SBCs like Raspberry Pi
- If the build completes successfully, you should see the .so file generated inside the build folder.
$ ls libdxl_x86_cpp.so Makefile - Grant permission to access the port
$ sudo chmod 666 /dev/ttyUSB0
- Common
makecommands for building the SDK$ make # Compile the source code and generate binaries $ make install # Install the library files to the system $ make clean # Remove all build files and reset the build environment $ make uninstall # Remove files installed by 'make install' from the system $ make reinstall # Reinstall by cleaning, rebuilding, and installing again
CMake Build
- Latest DYNAMIXEL SDK supports CMake build.
Build System Update
The existing OS-specific make build system has been unified into a single CMake-based build system.
| Category | Legacy (make) |
New (cmake) |
|---|---|---|
| Build file | OS-dependent | Unified across platforms |
| Generated Files | libdxl_{sys_env}_cpp.so |
libdxl_cpp.so |
| Install Include Paths | /usr/local/include/dynamixel_sdk/ |
/usr/local/include/dynamixel_sdk/ |
Build with CMake
Install build-essential, and cmake.
$ sudo apt-get install build-essential
$ sudo apt-get install cmake
Build the SDK. --target install option makes the library files installed to the system.
You can skip installing the library files by omitting the –target install option.
$ cd DynamixelSDK/c++
$ sudo cmake -B cmake_build
$ sudo cmake --build cmake_build --target install
$ sudo cmake --build cmake_build --target uninstall # Uninstall the library files from the system
Build result can be found in the cmake_build folder and the library files are installed to the system(/usr/local/lib/libdxl_cpp.so, /usr/local/include/dynamixel_sdk/).
Build the Example Code with CMake
The example code also supports unified CMake build.
The executable file can be found in the build folder.
$ cd DynamixelSDK/c++/example/protocol2.0
$ sudo cmake -B build
$ sudo cmake --build build
$ cd build
$ ./broadcast_ping
Library Setup <C++ Windows>
This section provides instructions on building the SDK.
Install requirements
-
In this section, we used visual studio as the IDE for building the SDK.
Download Visual Studio Community for Windows Desktop

Build the SDK
NOTE: This instruction assumes a 64-bit Windows system. If you are using 32-bit Windows, simply follow the same steps using the 32-bit version instead.
-
Open the project solution file (
dxl_x64_cpp.sln) located in the[DynamixelSDK folder]/c++/build/win64directory.
-
If below dialog appears, select
OK. This will adjust the toolset settings depending on your version of Visual Studio and Windows.
-
In the Solution Explorer on the right side, right-click the dxl_x64_cpp solution and select Build.

- The SDK build is complete.
- If the build was successful, the compiled library file will be saved at :
[DynamixelSDK folder]/c++/build/[win64]/output/dxl_x64_cpp.dll
Check Build Properties
-
You can check or change the build properties through right-clicking on the project in the Solution Explorer and selecting Properties.

-
Build properties is shown as below

- Output Directory:
$(SolutionDir)output\ - Intermediate Directory:
$(Configuration)\ - Platform Toolset:
Visual Studio 20XX (v000) - Configuration Type:
Dynamic Library (.dll)

- Additional Include Directories:
..\..\..\include\dynamixel_sdk
- Output Directory:
WARNING:
If the library file needs to be built in a lower or higher version of Visual Studio, change the Platform Toolset into the needed value. (ex: To use the DynamixelSDK c ver. library file in the MATLAB 2010 or LabVIEW 2010, the Platform Toolset should be changed to Visual Studio 2009 lower.)
CMake Build
- Latest DYNAMIXEL SDK supports CMake build.
Build System Update
The existing OS-specific make build system has been unified into a single CMake-based build system.
| Category | Legacy (sln) |
New (cmake) |
|---|---|---|
| Build file | OS-dependent | Unified across platforms |
| Generated Files | libdxl_{sys_env}_cpp.dll |
libdxl_cpp.dll |
| Install Include Paths | C:\Program Files (x86)\dynamixel_sdk\include\dynamixel_sdk\ |
Build with CMake
Install cmake from cmake download.
Download the msi file and install it.

Install Visual Studio build tools from Visual Studio download.
Start Visual Studio Installer and install the build tools.

After installation, open the x64 Native Tools Command Prompt for VS as administrator and navigate to the DynamixelSDK/c++ directory.
Build the SDK. --target install option makes the library files installed to the system.
You can skip installing the library files by omitting the –target install option.
$ cd DynamixelSDK/c++
$ cmake -B cmake_build
$ cmake --build cmake_build --target install
$ cmake --build cmake_build --target uninstall # Uninstall the library files from the system
Build result can be found in the cmake_build folder and the library files are installed to the system(C:\Program Files (x86)\dynamixel_sdk).
Build the Example Code with CMake
The example code also supports unified CMake build.
The executable file can be found in the build/Debug folder.
$ cd DynamixelSDK/c++/example/protocol2.0
$ cmake -B build
$ cmake --build build
$ cd build/Debug
$ set PATH=C:\Program Files (x86)\dynamixel_sdk\bin;%PATH%
$ broadcast_ping.exe
Library Setup <C++ macOS>
Maintenance is in progress. We apologize for your inconvenience. The manual is available in the near future.

