我从http://llvm.org/releases/3.9.0/LLVM-3.9.0-win32.exe安装了clang 3.9。
clang version 3.9.0 (branches/release_39)
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
使用gcc 6.2.0 (Mingw-w64)
gcc (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
我电脑上没有安装MSVC和Windows SDK,我需要clang的某些特定功能,并希望将其替换为g++,因为我使用C++。当我尝试编译简单文件时,出现以下错误:
fatal error: 'string' file not found
这是否意味着我的当前clang安装不支持在Windows上使用mingw?基本上,我想做的就是使用来自我的mingw-w64安装的头文件和库。我正在寻找解决方案,但并没有找到任何有用的信息。我不知道该怎么办。
这是否也意味着我的clang安装依赖于我没有的MSVC?
编辑: 从此页面的评论:http://blog.johannesmp.com/2015/09/01/installing-clang-on-windows-pt2/
这不再适用于最新的二进制文件(3.7.1、3.8、3.9)了,因为这些文件是使用Visual Studio和为Visual Studio编译的。
您可以安装完整的Visual Studio 2015(大约需要8GB),或者安装“Microsoft Visual C++ Build Tools 2015 Update 3”,其中包含VS的命令行工具和Clang需要的标准C++头文件。
我觉得这解释了一切。这是否意味着我需要使用mingw构建才能使其与mingw配合使用?
-msvc
。正如您所说,最新版本默认针对msvc,那时就是我的问题所在。没有简单的方法只选择使用gnu而不是他们的最新版本,因此我有三种方法-降级,使用MSYS2或自己构建。 - Konrad