Re: Adding own Library to project

Patrick Boettcher <patrick.boettcher@...>

Hi Patrick,

On Wed, 13 Jun 2018 10:54:57 +0200
König Patrick <Patrick.Koenig@...> wrote:


My name is Patrick König. I am new to zephyr. I just wrote a couple
of functions as additions to the zephyr/samples/subsys/usb/cdc_acm
Sample Project for the Nordic nRf52840. These are working fine and
have been tested.

Now I moved these functions from the main.c file to a custom module
(.c and .h) within the src folder of my project. While doing so I
managed to build the object file by keeping the sources in the source
folder as described in the documentation. Unfortunately I get errors
from the linker telling me that I have undefined references to my
The most convenient way of adding additional sources to your
application outside zephyr is using

target_sources(app PRIVATE src1.c src2.c)

in the CMakeLists.txt of your application (there where you are
including Zephyr's boilerplate.cmake).

I'm not sure whether that answers your question. Feel free to give some
more details and code-example if appropriate.

best regards,

Join to automatically receive all group messages.