I recently installed ESP-IDF v5.4 on Windows 11, but when I attempt to run idf.py ports
, I encounter the following error:
[2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Espressif\tools\esp-clang\esp-18.1.2_20240912\esp-clang\bin\clang.exe CMakeFiles/cmTC_604d4.dir/testCCompiler.c.obj -o cmTC_604d4.exe -Wl,--out-implib,libcmTC_604d4.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
FAILED: cmTC_604d4.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Espressif\tools\esp-clang\esp-18.1.2_20240912\esp-clang\bin\clang.exe CMakeFiles/cmTC_604d4.dir/testCCompiler.c.obj -o cmTC_604d4.exe -Wl,--out-implib,libcmTC_604d4.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
ld.lld: error: unknown argument '--major-image-version'
ld.lld: error: unknown argument '--minor-image-version'
ld.lld: error: cannot open 0: No such file or directory
ld.lld: error: unable to find library -lkernel32
ld.lld: error: unable to find library -luser32
ld.lld: error: unable to find library -lgdi32
ld.lld: error: unable to find library -lwinspool
ld.lld: error: unable to find library -lshell32
ld.lld: error: unable to find library -lole32
ld.lld: error: unable to find library -loleaut32
ld.lld: error: unable to find library -luuid
ld.lld: error: unable to find library -lcomdlg32
ld.lld: error: unable to find library -ladvapi32
clang: error: ld command failed with exit code 1 (use -v to see invocation)
My Understanding:
It seems that the compilation command generated by Clang is incorrect. The ld.lld linker does not support the --major-image-version and --minor-image-version arguments, and it also fails to locate system libraries.
Questions:
Which linker is supposed to support --major-image-version and --minor-image-version? Are the missing libraries provided by the "CMake tools for Windows" and "Windows 10 SDK" that I installed, or should they be included in the ESP-IDF installation? Any insights on how to resolve this issue would be greatly appreciated!
I recently installed ESP-IDF v5.4 on Windows 11, but when I attempt to run idf.py ports
, I encounter the following error:
[2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Espressif\tools\esp-clang\esp-18.1.2_20240912\esp-clang\bin\clang.exe CMakeFiles/cmTC_604d4.dir/testCCompiler.c.obj -o cmTC_604d4.exe -Wl,--out-implib,libcmTC_604d4.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
FAILED: cmTC_604d4.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Espressif\tools\esp-clang\esp-18.1.2_20240912\esp-clang\bin\clang.exe CMakeFiles/cmTC_604d4.dir/testCCompiler.c.obj -o cmTC_604d4.exe -Wl,--out-implib,libcmTC_604d4.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
ld.lld: error: unknown argument '--major-image-version'
ld.lld: error: unknown argument '--minor-image-version'
ld.lld: error: cannot open 0: No such file or directory
ld.lld: error: unable to find library -lkernel32
ld.lld: error: unable to find library -luser32
ld.lld: error: unable to find library -lgdi32
ld.lld: error: unable to find library -lwinspool
ld.lld: error: unable to find library -lshell32
ld.lld: error: unable to find library -lole32
ld.lld: error: unable to find library -loleaut32
ld.lld: error: unable to find library -luuid
ld.lld: error: unable to find library -lcomdlg32
ld.lld: error: unable to find library -ladvapi32
clang: error: ld command failed with exit code 1 (use -v to see invocation)
My Understanding:
It seems that the compilation command generated by Clang is incorrect. The ld.lld linker does not support the --major-image-version and --minor-image-version arguments, and it also fails to locate system libraries.
Questions:
Which linker is supposed to support --major-image-version and --minor-image-version? Are the missing libraries provided by the "CMake tools for Windows" and "Windows 10 SDK" that I installed, or should they be included in the ESP-IDF installation? Any insights on how to resolve this issue would be greatly appreciated!
Share Improve this question asked Mar 10 at 19:54 BaruchLiBaruchLi 1,1032 gold badges12 silver badges21 bronze badges 2 |1 Answer
Reset to default 0The problem was caused by wrong current directory. I should run idf.py command under project directory and not under C:\Espressif\frameworks\esp-idf-v5.4
esp-clang
compiler is a cross-compiler that builds for the ESP32 processor. Did you runinstall.bat
? – Tim Roberts Commented Mar 10 at 20:02