Inclusion of zephyr/net/socket.h

Hi,

I have an issue with a freestanding application I built.

I am working with the nRF9160 DK, and an installation of nRF Connect for VS Code on a Linux Virtual machine.

I'm trying to implement an LTE connection to a server with post request and I'm having an include error in one of my files.

cannot open source file "picolibc.h" (dependency of "zephyr/net/socket.h")C/C++(1696)

I tried to modify KConfig by including Picolibc Module but it doesn't seem to change anything.

I thought the problem might come from the way I wrote my prj.conf file or CMakeLists.txt file, but I didn't find much help on the internet on how to write those in my case, so if someone has useful links to share I would be very grateful.

The output of the CMake build is

[variant] Loaded new set of variants
[kit] Successfully loaded 2 kits from /home/maindir/.local/share/CMakeTools/cmake-tools-kits.json
[presetController] Successfully validated presets in /home/path-to-my-app/CMakePresets.json
[proc] Executing command: /usr/bin/cmake --version
[main] Configuring project: my-app 
[proc] Executing command: /usr/bin/cmake -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD=nrf9160dk_nrf9160_ns -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DCONF_FILE=/home/octech/Documents/Pifil/pifil-nrf9160/prj.conf -S/home/octech/Documents/Pifil/pifil-nrf9160 -B/home/octech/Documents/Pifil/pifil-nrf9160/build -G Ninja
[cmake] Loading Zephyr default modules (Zephyr base (cached)).
[cmake] -- Application: /path-to-my-app
[cmake] -- CMake version: 3.22.1
[cmake] -- Cache files will be written to: /home/maindir/.cache//zephyr
[cmake] -- Zephyr version: 3.3.99 (/home/maindir/ncs/zephyr)
[cmake] -- Found west (found suitable version "1.1.0", minimum required is "0.7.1")
[cmake] -- Board: nrf9160dk_nrf9160_ns, Revision: 0.7.0
[cmake] -- Found host-tools: zephyr 0.16.0 (/home/maindir/zephyr-sdk-0.16.0)
[cmake] -- Found toolchain: zephyr 0.16.0 (/home/maindir/zephyr-sdk-0.16.0)
[cmake] -- Found BOARD.dts: /home/maindir/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
[cmake] -- Generated zephyr.dts: /home/path-to-my-app/build/zephyr/zephyr.dts
[cmake] -- Generated devicetree_generated.h: /home/path-to-my-app/build/zephyr/include/generated/devicetree_generated.h
[cmake] -- Including generated dts.cmake file: /home/path-to-my-app/build/zephyr/dts.cmake
[cmake] Parsing /home/maindir/ncs/zephyr/Kconfig
[cmake] Loaded configuration '/home/path-to-my-app/build/zephyr/.config'
[cmake] No change to configuration in '/home/path-to-my-app/build/zephyr/.config'
[cmake] No change to Kconfig header in '/home/path-to-my-app/build/zephyr/include/generated/autoconf.h'
[cmake] CMake Warning at /home/maindir/ncs/zephyr/CMakeLists.txt:838 (message):
[cmake]   No SOURCES given to Zephyr library: lib__libc__common
[cmake] 
[cmake]   Excluding target from build.
[cmake] 
[cmake] 
[cmake] Dropping partition 'nrf_modem_lib_trace' since its size is 0.
[cmake] Dropping partition 'nonsecure_storage' since it is empty.
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: /home/path-to-my-app/build

It builds ok but I'm concerned about the part that says

No SOURCES given to Zephyr library: lib__libc__common

Excluding target from build.

I think I really need the socket.h inclusion for my file, I don't know any other alternative, but it causes problem in my entire app.

Can someone help me with this issue ?

Thanks in advance.

Related