Page 1 of 1

idf.py build fails on windows 10 projects with threading

Posted: Sat May 08, 2021 8:16 pm
by johncblacker
I'm trying to build a project using the windows 10 esp-idf toolset and I get a linker failure as noted below:
*************************************** log output ******************************************************************
[94/102] Linking C static library esp-idf\soc\soc\esp32\libsoc_esp32.a
[95/102] Linking C static library esp-idf\soc\libsoc.a
[96/102] Linking C static library esp-idf\micro-ecc\libmicro-ecc.a
[97/102] Linking C static library esp-idf\bootloader_support\libbootloader_support.a
[98/102] Linking C static library esp-idf\efuse\libefuse.a
[99/102] Linking C static library esp-idf\spi_flash\libspi_flash.a
[100/102] Linking C static library esp-idf\main\libmain.a
[101/102] Linking C executable bootloader.elf
[102/102] Generating binary image from built executable
esptool.py v3.0
Generated C:/Users/jobla/Documents/OpenCV-Projects/examples/esp_opencv_tests/build/bootloader/bootloader.bin
[935/936] Linking CXX executable esp_opencv_tests.elf
FAILED: esp_opencv_tests.elf
cmd.exe /C "cd . && C:\Users\jobla\.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address @CMakeFiles\esp_opencv_tests.elf.rsp -o esp_opencv_tests.elf && cd ."
c:/users/jobla/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:/users/jobla/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/lib/esp32-psram/no-rtti\libstdc++.a(thread.o):(.literal._ZNSt6thread20hardware_concurrencyEv+0x0): undefined reference to `sysconf'
c:/users/jobla/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:/users/jobla/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/lib/esp32-psram/no-rtti\libstdc++.a(thread.o): in function `std::thread::hardware_concurrency()':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/src/c++11/thread.cc:177: undefined reference to `sysconf'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
************************** END OF LOG OUTPUT ************************************
I tried two different example projects from joachimBurkat's esp32-openCV git project examples directory. The hello_opencv project built fine, but the ttgo_demo and the esp_opencv_tests projects both fail with the undefined reference to 'sysconf' as noted in the output above. I need some help.