esp-rs / esp-idf-hal

embedded-hal implementation for Rust on ESP32 and ESP-IDF
https://docs.esp-rs.org/esp-idf-hal/
Apache License 2.0
472 stars 171 forks source link

Unable to find libclang: libclang.dll could not be opened: LoadLibraryExW failed #477

Closed Tnze closed 2 months ago

Tnze commented 2 months ago

Follow the tutorial to configure the development environment, but in the end, cargo build still failed to compile

  Using managed esp-idf repository: RemoteSdk { repo_url: None, git_ref: Tag("v5.2.2") }
  Using esp-idf v5.2.2 at 'F:\e\.embuild\espressif\esp-idf\v5.2.2'
  Built components: riscv, esp_ringbuf, efuse, esp_mm, driver, esp_pm, mbedtls, esp_bootloader_format, esp_app_format, bootloader_support, bootloader, esptool_py, partition_table, esp_partition, app_update, spi_flash, pthread, esp_system, esp_rom, hal, log, heap, soc, esp_hw_support, freertos, newlib, cxx, esp_common, esp_timer, app_trace, esp_event, nvs_flash, esp_phy, vfs, lwip, esp_netif_stack, esp_netif, wpa_supplicant, esp_coex, esp_wifi, bt, unity, cmock, console, http_parser, esp-tls, esp_adc, esp_eth, esp_gdbstub, esp_hid, tcp_transport, esp_http_client, esp_http_server, esp_https_ota, esp_https_server, esp_psram, esp_lcd, protobuf-c, protocomm, esp_local_ctrl, espcoredump, wear_levelling, sdmmc, fatfs, idf_test, ieee802154, json, mqtt, nvs_sec_provider, openthread, spiffs, ulp, usb, wifi_provisioning, main
  thread 'main' panicked at F:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\bindgen-0.69.4\lib.rs:622:31:
  Unable to find libclang: "the `libclang` shared library at C:\\Users\\Tnze\\.rustup\\toolchains\\esp\\xtensa-esp32-elf-clang\\esp-clang\\bin\\libclang.dll could not be opened: LoadLibraryExW failed"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Full logs

Also seen #319 with the same error, which should be already fixed. BTW I didn't found a clang.exe file in C:\Users\Tnze\.rustup\toolchains\esp\xtensa-esp32-elf-clang\esp-clang\bin image

Vollbrecht commented 2 months ago

This problem is not directly related to the hal but to how the xtensa toolchain gets installed. The issue is already tracked in espup here