Synchronizing Sysroot

In order to speed up building of projects for relatively slow devices, VisualGDB supports using cross-toolchains. A cross-toolchain runs on the fast Windows machine, but produces executables that will run on the target Linux board. This is usually faster than building the code directly on the Linux board.

To make sure the toolchain produces the executables and libraries that can run on the board, it typically contains a copy of the target’s root file system in a separate sysroot directory (e.g. C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot). The sysroot directory contains copies of headers and libraries that are present on the target, so that the toolchain could use them when building the code.

If you install additional libraries on the target, or update some library versions, the sysroot directory must be resynchronized with the target (i.e. the newly installed files must be copied inside the sysroot directory). This can be done by clicking the “Synchronize Sysroot” button in VisualGDB Project Properties:Normally, resynchronizing the sysroot with the default settings should be sufficient. However, if you have installed some libraries outside of the regular header and library directories, you would need to add their locations to the Synchronized Directories list:Once the sysroot has been synchronized, you will be able to build projects relying on the newly installed libraries using the cross-compiler.

Note that if you want to explicitly reference include or library directories inside the sysroot, you can use the the “=/usr/path” syntax for MSBuild and “${CMAKE_SYSROOT}/usr/path” syntax for CMake-based projects.

Troubleshooting

You can troubleshoot sysroot synchronization issues by enabling SysprogsSync logging via Tools->Options->VisualGDB->General->SSH->Log SysprogsSync Transfers. As soon as this option is enabled, synchronizing sysroot will create the SysprogsSync.log file in the sysroot directory, that will contain a detailed list of all synchronization actions.