How build zephyr civetweb sample with pio?

Hi, I tried to build the civetweb example from the zephyr samples (.platformio\packages\framework-zephyr\samples\net\sockets\civetweb) for the Nucleo-F767zi with PlatformIO under Windows but I always failed…
Maybe some could tell me how to configure the project and get a successful build at the end.

What I’ve done (and tried) so far:

  1. Created a empty pio project with pio.ini:
    platform = ststm32 board = nucleo_f767zi framework = zephyr
  2. Copied the content of the src folder from the civetweb sample into the projects src folder.
  3. Copied the prj.conf file from the sample into the projects zephyr folder.
  4. Build the project… Failed because libc_extensions.h was not found by civetweb.c
    Okay, no problem at all…
  5. Just added the src directory to include paths in projects zephyr/CMakeLists.txt: zephyr_include_directories(../src)
  6. Build the project… Compling ok… Linking failed due to a bunch of undefined references.

You can find my (not building) test project at github: GitHub - julianobst/pio-zephyr-civetweb-example

I also tried to build the example with west and the zephyr toolchain under linux (native and docker) and both times the build was successful and worked as expected.

I would appreciate any help.

Many thanks,
Julian

Finaly found my mistake. Now the example builds and run as expected.

I missed to add
set(gen_dir ${ZEPHYR_BINARY_DIR}/include/generated/)
into the zephyr/CMakeLists.txt file.

That’s all…

Maybe this helps someone else to save hours (or days) of time :slight_smile:

1 Like