Michael
Michael

Reputation: 2566

Raspberry Pi pico C/C++ SDK integration with VSCode

I am trying to get the Pico SDK working with VS-Code on Mac OSX.

As you can see in the screenshot below the include is not recognised.

I set the SDK path in PICO_SDK_PATH and stored this path as an environment variable. Inside VSCode if I use the CMake Tool extension the build works correctly.

in the c_cpp_properties.json I explicitly included the SDK location

"includePath": [
                "${workspaceFolder}/**",
                "/Users/MY_USER/pico/pico-sdk/**"
            ],

screenshoot

Does anyone know how to remove this squiggly lines when including pico headers ?

Upvotes: 0

Views: 2242

Answers (1)

Terra
Terra

Reputation: 120

"/Users/MY_USER/pico/pico-sdk/**"

This seems incorrect. Try this:

"includePath": [
    "${workspaceFolder}/**",
    "~/pico/pico-sdk/**"
],

~ points to the home directory. On Windows this is C:\Users\USERNAME and on Linux /home/USERNAME.

Inside VSCode if I use the CMake Tool extension the build works correctly.

This is because the compiler does not use the settings from c_cpp_properties.json. Instead they are used for IntelliSense to work correctly, see this article.

Upvotes: 1

Related Questions