cancel
Showing results for 
Search instead for 
Did you mean: 

Can't include libraries in visual code studio

Manu_30
Associate II

Hello,

I try to do a little code for STM32F103 MCU using Visual Code Studio with STM32 VS code Extension.

I can generate and compile base code using STM32CubeMX importation feature.

But I'm stuck with adding external libraries to the project.

What i've done is to modify the "c_cpp_properties.json" file of the project to add the path to the library I want to use.

Here the current file :

 

{
    "version": 4,
    "configurations": [
        {
            /** 
             * ms-vscode.cmake-tools plugin should be installed.
             * 
             * It provides data for C/C++ plugin,
             * such as include paths, browse paths, defines, etc.
             */
            "name": "STM32",
            "includePath": [
                "lib/ssd1351"
            ],
            "configurationProvider": "ms-vscode.cmake-tools",
            //"intelliSenseMode": "${default}",
            "intelliSenseMode": "gcc-arm"
        }
    ]
}

 

 

But when I include the ssd1351.h header in the main.c file, it fail :

 

 

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "ssd1351.h"
/* USER CODE END Includes */

 

 

Can someone point me to the solution for including external libraries in an VScode project ?

Thank you

11 REPLIES 11

However, when you regenerate the project using CubeMX, any paths you added in the cmake folder will be overwritten.

Snipaste_2025-10-12_16-46-38.png