Building programs in Visual Studio Code

To build a program in Visual Studio Code:

  1. Open the program project directory in Visual Studio Code.
  2. Make sure that the program has been packed into a KPA package.

    You must use the CMake commands of the kpa library to pack a program into a KPA package.

    Important! When creating a startup configuration using the CMake command add_kpa_component(), you must specify the kl.Kds value in the EIID field.

    Also, if the started program uses file systems (via the VFS component), you must specify the value VFS_FILESYSTEM_BACKEND=client:kl.VfsSdCardFs in the ENV field when creating a startup configuration using the CMake command add_kpa_component().

    For example:

    add_kpa_component(Hello.kpa RUN_CONFIGURATION "app" NAME "Hello app" TYPE "service" EIID "kl.Kds" PATH "bin/Hello" ENV "VFS_FILESYSTEM_BACKEND=client:kl.VfsSdCardFs

  3. Make sure that the project was correctly identified based on the appearance of extension buttons in the lower panel. If the buttons do not appear, manually activate the solution by running the command KOS: Activate extension in this directory.
  4. Select the build architecture by clicking the build architecture selection button in the lower panel (the button shows the current architecture, for example: aarch64-kos).
  5. If you are planning to debug the built program, you must open the additional build parameters by clicking the build options selection button in the lower panel, specify the debug build type in the drop-down list, and select the gdbstub check box. By default, this button shows type=debug.
  6. Build all targets by clicking the Build all targets button in the lower panel.
Page top