Veethree D7 SDK
Loading...
Searching...
No Matches
Build toolchains on Windows

< Build Toolchain

This page goes into detail about the toolchains packaged by the D7 SDK. It will explain the external dependencies for the host machine, why there are separate toolchains for the host machine and the target device, the dependency between them and a rough guide on what each toolchain contains.

Location of the toolchains

From the D7 SDK installation directory, the toolchains can be found in the toolchain\sysroots subdirectory.

toolchain\sysroots\
├── armv8a-veethree-linux
└── x86_64-w64-mingw32

In each sysroot you will find executables, shared libraries, static libraries, include headers and package configuration files for CMake and pkg-config packages in the locations you would expect in a regular Linux distribution; i.e. binaries in usr/bin, libraries in usr/lib, headers in usr/include, configurations in etc, etc.

Target device toolchain

The target device toolchain contains the headers, shared libraries and static libraries necessary for compiling an application for the target.

All the files in toolchain\sysroots\armv8a-veethree-linux, binary or text, refer to the rootfs on the target device and are also compiled for the target device; as such, they will not run on the host.

Using the target toolchain

You need to enable the development environment in every shell where you will be compiling projects for the target device. This should be done by invoking the %USERPROFILE%\d7-sdk\toolchain\environment-setup-armv8a-veethree-linux.bat script in the current shell. This will set a number of environment variables in the current shell to make sure that C and C++ projects are compiled and linked for the target device.

For examples of sourcing the toolchain and building app see:

Developing for the D7 Platform using Qt Creator

To use Qt Creator for compiling for the D7, you will need to add the D7 SDK's Qt Creator Kit. Please see Adding the D7 SDK as a Kit in Qt Creator for a guide on how to do that.

Host toolchain

Note: The target toolchain depends on utilities from the host sysroot.

In addition to the development tools, the host toolchain also contains some of the libraries available on the target to allow testing some application functionality on the host machine before testing on the target.

Not all the target functionality is available on the host. Specifically, hardware interfaces (described in I/O: Analog, Digital, PWM) are mocked on the host, and libraries required for that functionality are not included in the host toolchain (for instance, libgpiod is not available on the host toolchain because gpio functionality is not available on the host via the D7 SDK).

External dependencies for the host toolchain

On Windows, the libraries that exist in the host SDK have been built to be compatible with the Desktop Qt 6.10.2 MinGW 64-bit kit.

Installing the toolchain

If you have followed Qt install step and installed the MinGW toolchain, you can skip this section.

If Qt is installed but MinGW isn’t, use the Qt Maintenance Tool to add it. Otherwise, download the toolchain separately.

Installing MinGW toolchain using Qt Maintenance tool

To add the toolchain as an install component:

  1. Run MaintenanceTool.exe in Qt installation directory by double clicking on the file
  2. Login to your Qt account to proceed
  3. Select "Add or remove components" and click on "Next".
  4. Expand the "Qt" dropdown and under that, expand the "Build Tools" dropdown.
  5. Select "MinGW 13.1.0 64-bit" and click on "Next" to proceed with installation.

Installing MinGW toolchain without Qt

The toolchain can be downloaded from here independently of Qt. After downloading the file, extract the toolchain.

To use the toolchain, you will need to add the %toolchain_path%\mingw1310_64\bin, the downloaded toolchain's bin folder, to the PATH environment variable to make the tools available on the command line and to other tools such as CMake. Pick one of the two methods below.

Prepending toolchain to PATH

Temporary PATH value

You will need to run this everytime you start a new terminal session. For persistent variables see the next section.

If you have downloaded the toolchain independently, run:

:: Update the EXTRACT_PATH variable before running this
set EXTRACT_PATH="Path Archive was extracted"
set PATH=%EXTRACT_PATH%\Tools\mingw1310_64\bin;%PATH%

If you have installed the toolchain using Qt Maintenance Tool, the toolchain will be installed in Qt install location, which is assumed to be C:\Qt. Add the toolchain to PATH using:

set PATH=C:\Qt\Tools\mingw1310_64\bin;%PATH%

Persistent PATH value

Adding variables here will persist between terminal sessions.

  1. Open the start menu and search for "Environment variables"
  2. You should see "Edit the system environment variables". Click that result
  3. The System properties window should appear. Click "Environment variables" at the bottom
  4. Now edit either the User variables or System variables PATH entry.
    1. System variables affect every user on the system
    2. User variables only affect the currenty signed in user
  5. Add the toolchain bin folder to PATH %TOOLCHAIN_PATH%\Tools\mingw1310_64\bin
    1. Replace %TOOLCHAIN_PATH%% with the actual toolchain path— either the directory where you extracted the toolchain or, if installed via the Qt Maintenance Tool or Qt installer, the Qt installation directory.
  6. Once finished, click Ok
  7. Click Apply on the system properties window
  8. The new entry will now persist and will be automatically added to PATH

Using the host toolchains

To build and run apps on the host, the host toolchains need to be sourced to set required environment variables in the current shell. Please refer to Windows Host Builds for full instructions to build and run both CLI and QML apps.

Building D7 SDK applications on the host using Qt Creator

To use Qt Creator for compiling D7 SDK applications for the host, it is good practice to create a clone of the default desktop kit, such that it can be rebuilt as many times as needed in case it ever drifts from a working configuration.

Please see Qt host build kit for windows.