4

So I have everything setup to compile in Windows Subsystem for Linux and that is all working fine. I'm writing my code in VS Code and it doesn't recognize the headers such as "pico/stdlib.h". The code compiles and works fine but it would be nice to get Code setup properly so I get the auto-fill features and such.

How do I properly link the SDK libs with VS Code?

Thanks!

Peter Macej
  • 4,831
  • 22
  • 49
Jake A
  • 83
  • 1
  • 8
  • You need to set up VS code for your build environment via some JSON nonsense: https://stackoverflow.com/questions/37522462/visual-studio-code-include-stdio-h-saying-add-include-path-to-settings. – Clifford Apr 29 '22 at 18:00

1 Answers1

7

I experienced this same issue.

Edit the include path by hovering over the red underlined #include lines, click Quick fix..., and click the edit includePath option.

enter image description here

Scroll down to the Include path section and add ${env:PICO_SDK_PATH}/**. Make sure the setting saves properly. This adds the SDK directory by the PICO_SDK_PATH environment variable which contains the headers and associated files.

enter image description here

Hope this helps!

youngermax
  • 114
  • 1
  • 6
  • 1
    Awesome! I started using Atom since I switched to Linux but this will probably help others. – Jake A Nov 15 '22 at 00:05