Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

#error directive: "Board is not defined" Visual Studio Code

Hi all. 

First I would like to apologize for any mistake because I'm posting first time here.

I'm using Visual Studio Code (VSC) to evaluate the blinky example from nRF5 SDK (located in examples/peripherals). I set up all the include paths correctly and all headers are loaded.

However, I'm having error with LEDS_NUMBER is undefined in main.c. Going to definition points to multiple headers the included in board.h.

Going to definition of board.h, I have the problem at line 87: #error "Board is not defined". The error is #error directive: "Board is not defined" . The example build just fine, and I can use Jumper Vlab to test the built file.

What could be the problem? Does VSC confused with multiple headers?

I read a similar problem with Keil, and the fix was to specify a board for Keil. Is this similar to what I've having with VSC, because this is compiler error flag, maybe VSC got confused of what board is being used?

Here are the screenshots:

main.c

board.h

Parents Reply Children
No Data
Related