espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.62k stars 7.27k forks source link

error: implicit declaration of function 'htole16' (IDFGH-11101) #12273

Closed franz-ms-muc closed 1 year ago

franz-ms-muc commented 1 year ago

Answers checklist.

IDF version.

ESP-IDF Release v5.1.1

Operating System used.

Windows

How did you build your project?

Eclipse IDE

If you are using Windows, please specify command line type.

None

What is the expected behavior?

No Error

What is the actual behavior?

Error

Steps to reproduce.

  1. Step
  2. Step
  3. Step ...

sdkconfig:

https://gist.github.com/franz-ms-muc/95f9ded3c8a2c3350e8a6e82e3be66c6

Build or installation Logs.

https://gist.github.com/franz-ms-muc/b70d3d13a259acf3dbf5303eaaa4651a

FAILED: esp-idf/wpa_supplicant/CMakeFiles/__idf_wpa_supplicant.dir/esp_supplicant/src/esp_wpa3.c.obj 
ccache C:\Espressif\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin\xtensa-esp32s3-elf-gcc.exe -DCONFIG_CRYPTO_MBEDTLS -DCONFIG_ECC -DCONFIG_IEEE80211W -DCONFIG_NO_RADIUS -DCONFIG_OWE_STA -DCONFIG_SAE -DCONFIG_SAE_PK -DCONFIG_SHA256 -DCONFIG_WPA3_SAE -DCONFIG_WPS -DEAP_MSCHAPv2 -DEAP_PEAP -DEAP_PEER_METHOD -DEAP_TLS -DEAP_TTLS -DESPRESSIF_USE -DESP_PLATFORM -DESP_SUPPLICANT -DIDF_VER=\"v5.1.1-dirty\" -DIEEE8021X_EAPOL -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DUDS_REPROGRAMMING -DUSE_WPA2_TASK -DUSE_WPS_TASK -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -D__ets__ -IC:/git/krone/ksc-2n/src/DLL -IC:/git/krone/ksc-2n/src/OS/os_wrapper/include -IC:/git/krone/ksc-2n/build/config -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/port/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/src -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/src/utils -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/src/crypto -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/newlib/platform_include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/freertos/esp_additions/include/freertos -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/freertos/esp_additions/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/freertos/esp_additions/arch/xtensa/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_hw_support/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_hw_support/include/soc -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_hw_support/include/soc/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_hw_support/port/esp32s3/. -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_hw_support/port/esp32s3/private_include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/heap/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/log/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/soc/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/soc/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/soc/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/hal/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/hal/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/hal/platform_port/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_rom/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_rom/include/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_rom/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_common/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_system/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_system/port/soc -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_system/port/include/private -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/xtensa/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/xtensa/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_timer/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/lwip/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/lwip/include/apps -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/lwip/include/apps/sntp -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/lwip/lwip/src/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/lwip/port/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/lwip/port/freertos/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/lwip/port/esp32xx/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/lwip/port/esp32xx/include/arch -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/mbedtls/port/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/mbedtls/mbedtls/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/mbedtls/mbedtls/library -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/mbedtls/esp_crt_bundle/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_wifi/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_wifi/wifi_apps/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_event/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_phy/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_phy/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.1.1/components/esp_netif/include -mlongcalls  -fdiagnostics-color=always -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Og -fmacro-prefix-map=C:/git/krone/ksc-2n=. -fmacro-prefix-map=C:/Espressif/frameworks/esp-idf-v5.1.1=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -Wno-maybe-uninitialized -includeC:/git/krone/ksc-2n/src/OS/os_wrapper/include/TraceHook.h -std=gnu17 -Wno-old-style-declaration -Wno-strict-aliasing -Wno-write-strings -Werror -Wno-format -MD -MT esp-idf/wpa_supplicant/CMakeFiles/__idf_wpa_supplicant.dir/esp_supplicant/src/esp_wpa3.c.obj -MF esp-idf\wpa_supplicant\CMakeFiles\__idf_wpa_supplicant.dir\esp_supplicant\src\esp_wpa3.c.obj.d -o esp-idf/wpa_supplicant/CMakeFiles/__idf_wpa_supplicant.dir/esp_supplicant/src/esp_wpa3.c.obj -c C:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c
C:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c: In function 'esp_send_sae_auth_reply':
C:/Espressif/frameworks/esp-idf-v5.1.1/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c:623:34: error: implicit declaration of function 'htole16' [-Werror=implicit-function-declaration]
  623 |     ((uint16_t *)req->data)[0] = htole16(auth_alg);
      |                                  ^~~~~~~
cc1.exe: all warnings being treated as errors

More Information.

No response

franz-ms-muc commented 1 year ago

LINUX: same Error.

igrr commented 1 year ago

-IC:/git/krone/ksc-2n/src/DLL -IC:/git/krone/ksc-2n/src/OS/os_wrapper/include

Very likely the issue may be caused by a conflicting header file in one of these include directories which you are adding globally. Probably wpa_supplicant is including some header file, and it gets found in these directories instead of the place where it should be found.

If that is the case, you can fix the issue by adding include directories just in your components, not globally for the whole application.

franz-ms-muc commented 1 year ago

i will check this ASAP

franz-ms-muc commented 1 year ago

no Errors anymore, just Warnings. must rename endian.c/h to os_endian.c/h, then it works.