Kotlin native; compilation failed: cannot run msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/clang++

237 Views Asked by At

I use Windows 7 and followed Get started with Kotlin/Native using the command-line compiler, downloaded kotlin-native-windows-1.5.10.zip and added its bin to the PATH of system. But when I try kotlinc-native hello.kt -o hello, get this error:

error: compilation failed: Cannot run program "C:\Users\<user-name>\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/clang++": CreateProcess error=193, %1 is not a valid Win32 application

What is the problem and how I can solve that?

Edit:

It seems the problem is caused by clang++.exewhich is in

C:\Users\<user-name>\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/

because when I try to run it, I get this error:

clang++ is not a valid Win32 application
0

There are 0 best solutions below