我正在尝试使用Visual Studio在Windows 10上安装LLVM,使用指南http://llvm.org/docs/GettingStartedVS.html,但我收到了错误:
以下是我在CMake GUI中的观点,我在其中指导它使用C ++编译器C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
。
我已经为构建创建了一个名为llvm的新目录,因为我无法在源目录中构建。
我做错了什么?
配置过程显示以下输出:
The C compiler identification is unknown
The CXX compiler identification is unknown
The ASM compiler identification is MSVC
Found assembler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
CMake Error at CMakeLists.txt:48 (project):
No CMAKE_C_COMPILER could be found.
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
CMake Error: Generator: execution of make failed. Make command was: "MSBuild.exe" "cmTC_c88f4.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake:44 (message):
The C++ compiler "C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/dev/llvm/CMakeFiles/CMakeTmp
Run Build Command:"MSBuild.exe" "cmTC_c88f4.vcxproj"
"/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
Generator: execution of make failed. Make command was: "MSBuild.exe"
"cmTC_c88f4.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:48 (project)
Configuring incomplete, errors occurred!
See also "C:/dev/llvm/CMakeFiles/CMakeOutput.log".
See also "C:/dev/llvm/CMakeFiles/CMakeError.log".
答案 0 :(得分:0)
我正在使用相同的设置(Windows 32位除外),我选择的LLVM版本是4.0.0。我按照教程使用clang进行设置。
我为整个过程做了笔记。 从源代码构建LLVM 4.0.0的说明:
注意:
我的环境变量供参考:
** INCLUDE = C:\ Program Files \ Microsoft Visual Studio 14.0 \ VC \ INCLUDE; C:\ Program Files \ Microsoft Visual Studio 14.0 \ VC \ ATLMFC \ INCLUDE; C:\ Program Files \ Windows Kits \ 10 \ include \ 10.0.10240.0 \ ucrt; C:\ Program Files \ Windows Kits \ NETFXSDK \ 4.6.1 \ include \ um; C:\ Program Files \ Windows Kits \ 8.1 \ include \ shared; C:\ Program Files \ Windows Kits \ 8.1 \ include \ um; C:\ Program Files \ Windows Kits \ 8.1 \ include \ winrt;
** LIBPATH = C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319; C:\ Program Files \ Microsoft Visual Studio 14.0 \ VC \ LIB; C:\ Program Files \ Microsoft Visual Studio 14.0 \ VC \ ATLMFC \ LIB; C:\ Program Files \ Windows Kits \ 8.1 \ References \ CommonConfiguration \ Neutral; \ Microsoft.VCLibs \ 14.0 \ References \ CommonConfiguration \ neutral;
如果在开发人员命令提示符下无法识别llvm工具(如clang,llc,lli等),请设置PATH环境变量。
希望这有帮助!