Include files in CMakeLists.txt

I'm doing some project cleanup and one of the weird errors/warnings concerns the Zephyr include files. In the IDE, I see errors like this all over the place:

You would think this would be a fatal error but the project builds fine. I guess I may need to add something in my CMakeLists.txt where all the include paths are customarily set up. Here's what mine looks like:

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(cm_fw_core)

target_sources(app PRIVATE
  src/main.c
  src/cm_jparser.c
  src/cm_mproc.c
  src/cm_utils.c
  src/cm_write_vout.c
  src/cm_read_analog.c
  src/cm_gpio.c
  src/lm5176.c
  src/cm_control_loop.c
)

include_directories(
  include
)

How can I fix this to remove the error/warning in the IDE?

  • Hello,

    Are these messages only showing up in the 'problems' tab of VSC? If so, you can disregard these messages.
    We are aware of the issue and our developers are working to have the problems tab either removed from the nRF Connect SDK context, or to display the correct information, but as of right now these messages does not convey much information.
    The issue is that the problems tab is VSC own attempt to help analyze the project code to identify issues, but it does not utilize the same paths that are used during builds in the nRF Connect SDK VSC extensions, and so it will regularly not be able to find files or other dependencies, so please disregard the 'problems' tab all together.
    The information worth looking at will be displayed in your build logs directly.

    Apologies for any confusion this might have caused, we are working on fixing this! :) 

    Best regards,
    Karl

Related