This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Adding header and source files to nRF Connect SDK Project

Hello all,

I am working on a custom application that requires gps, https post requests, SPI, and CAN, and I am having trouble adding source and header files to my project. Following the tutorial on the nRF Connect SDK documentation page, I am trying to add a new file to CMakeLists.txt by right clicking on Project 'app/libapp.a' , but sometimes the option to add a new file isn't available. Depending on which project you start with, there is no option to add new files to Cmake, which is strange.

I eventually found an example that allowed me to actually add files to CMake (at_client), but am now getting multiple errors and multiple stages of building. How can I add .h and .c files to CMakeLists.txt?

I have searched through devzone looking at examples but don't see a clear step by step manual for adding .c and .h files to an nRF Connect SDK project. Some examples say to add to the 'src' folder, but nowhere do I see a src folder. On most other IDEs I just create new folders for my header and source files and just add them there, but this doesn't seem to link correctly. Any help would be appreciated, thank you.

-Kyle Garland

Related