VS Code editor shows missing include, but blinky compiles. Error: 'cannot open source file "alloca.h" (dependency of "C:\Users\robb\.vscode\extensions\ms-vscode.cpptools-1.20.5-win32-x64\bin\zephyr\kernel.h")'

I'm running the latest nRF Connect under VS Code on Windows 11. 

What used to compile and not show errors (a couple weeks ago, and running 2.6.0) is now showing errors on the IDE, but still compiles and can be flashed.

tl;dr: This issue may be caused by the microsoft extension CMake Tools. I removed that and then resolved an intellisense warning by pointing it to the nRF Connect extension, and the issue went away.

Details:

Is the VS Code not in sync with the compiler? This was not previously the case, but something in VS Code seems to have changed. The project builds and I can flash it.

I then noticed that in the bottom right of VS Code there was a warning indication. I hovered over it and found:

I removed that extension hoping that may have been what caused the issue, and I'm not sure if it was that or another warning I saw a bit later:

Intellisense warning that suggested the nRF Connect extension for intellisense, possibly brought up because I removed the Microsoft CMAKE extension.

In the end, that seemed to cause the errors to go away. It had to scan the code for a bit before it cleared, I had to wait for about a minute.

Hope this helps the next one who encounters it!

Parents Reply Children
No Data
Related