Problems installing Clang on windows

I am trying to install clang in a virtual machine using Windows XP, first I will try with the pre-installed clang binaries for Windows from this page: LLVM Download and I get this error:

Failed to find MSBuild toolset directory 

So, I'm trying to compile clang after explaining the step in this question: Compiling Clang on Windows , but I also get the error message:

 In file included from C:\llvm-3.7.0.src\lib\Support\DynamicLibrary.cpp:40:0: C:\llvm-3.7.0.src\lib\Support\Windows/DynamicLibrary.inc:34:56: error: 'PENUMLOA DED_MODULES_CALLBACK64' has not been declared typedef BOOL (WINAPI *fpEnumerateLoadedModules)(HANDLE,PENUMLOADED_MODULES_CALL BACK64,PVOID); ^ C:\llvm-3.7.0.src\lib\Support\Windows/DynamicLibrary.inc: In static member funct ion 'static llvm::sys::DynamicLibrary llvm::sys::DynamicLibrary::getPermanentLib rary(const char*, std::string*)': C:\llvm-3.7.0.src\lib\Support\Windows/DynamicLibrary.inc:70:65: error: invalid conversion from 'BOOL (__attribute__((__stdcall__)) *)(PSTR, DWORD64, ULONG, PVOID) {aka int (__attribute__((__stdcall__)) *)(char*, long long unsigned int, long unsigned int, void*)}' to 'int' [-fpermissive] fEnumerateLoadedModules(GetCurrentProcess(), ELM_Callback, 0); ^ lib\Support\CMakeFiles\LLVMSupport.dir\build.make:1912: recipe for target 'lib/S upport/CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp.obj' failed mingw32-make[2]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/DynamicLibrary.cpp. obj] Error 1 CMakeFiles\Makefile2:200: recipe for target 'lib/Support/CMakeFiles/LLVMSupport. dir/all' failed mingw32-make[1]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2 Makefile:148: recipe for target 'all' failed mingw32-make: *** [all] Error 2 

So, I really do not know what to do at this moment or what I am doing wrong, so any help in this topic will be useful.

+5
source share
1 answer

You can see " " Developing IoT with PlatformIO "which shows the same error message.

http://electronicsworkbench.io/user/pages/02.blog/platformio/clang -install-error.jpg

Checking the installed files, I found install.bat in the C:\Program Files\LLVM\tools\msbuild .
It looks for the MSBuild toolbox directory in places such as " %ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets ", and copies some files from LLVM to the MSBuild directory if it finds them.
Otherwise, the above error is called.
This confirmed that the error does not apply to this environment, we can simply ignore it.

In your case, you cannot ignore it, so double check the contents / existence of this folder.

0
source

Source: https://habr.com/ru/post/1237194/


All Articles