This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Manually added source files in SES can't access zephyr.h

Hey guys,

i tried my best did my own research, but i can't get it to work.

I'm trying to manually add .c and .h files to a project in Segger Embedded Studio ialso put them in the src folder where the main.c file is.

I can include the header file in the main.c file, but inside the test.h file i can't include the zephyr.h or any other header from zephyr want to use.

here you can see my build-messages:

i've tried adding my source files to the cmakelists.txt, by adding

target_sources(app PRIVATE src/test.c) (same for the headerfile), but that also didn't work.

copying the additional code completion compiler options from main.c to test.c and test.h also didn't changed a thing about the error.

Did I miss something totally obvious?

My setup: nrf connect sdk 1.9.0; thingy91; Segger embedded studio v5.68; Windows11

Thank you for answers and Greetings,

Jannis

  • OK, sorry i search for such a long time and found the answer after i bothered you Sweat smile

    For someone having the same problems:

    in the CMakeLists.txt file in your project root, you need to put the nordic sdk start and end tags. Then you can add files to your cmake projects by rightclicking the project and then clicking adding new/existing file to cmakelists.txt. That does the trick.

    # NORDIC SDK APP START
    target_sources(app PRIVATE src/main.c src/helpers.c src/helpers.c)

    # NORDIC SDK APP END

    Have a nice day!

Related