在Windows中安装Clang的问题

时间:2015-12-01 20:51:44

标签: c++ windows install clang llvm-clang

我一直在尝试使用windows xp在虚拟机中安装clang,首先我从这个页面尝试使用Windows的预制二进制文件:LLVM Download我收到了这个错误:

Failed to find MSBuild toolset directory

所以,我尝试按照这个问题中的步骤解释编译clang:Compiling Clang in Windows,但我也收到错误:

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

所以我真的不知道该做什么或者我做错了什么,所以这个主题的任何帮助都会有所帮助。

1 个答案:

答案 0 :(得分:0)

您可以看到“IoT Development with PlatformIO”,它会显示相同的错误消息。

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

  

检查已安装的文件,我在install.bat目录中找到了C:\Program Files\LLVM\tools\msbuild   它在“%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets”等位置搜索MSBuild工具集目录,如果找到它们,则将一些文件从LLVM复制到MSBuild目录。
  否则抛出上述错误   这证实了错误与此环境无关,我们可以忽略它。

在您的情况下,您可能无法忽略它,因此请仔细检查该文件夹的内容/存在。