使用 MinGW 4.7.0,MSYS 编译的 Clang 3.2。
我通过自动安装程序/下载器获得了 MinGW,并按照以下说明构建了 Clang:http: //bencode.net/clangonwindows
在 PowerShell 上调用“g++ --version”会返回:enter code here
在 PowerShell 上调用“clang -v”会返回:clang version 3.2 (trunk 167353)
Target: i686-pc-mingw32
Thread model: posix
我创建了一个小测试文件来检查 clang 是否正常工作,“test.cpp”:
#include <iostream>
class clangIsCool
{
public:
int x;
int y;
};
int main()
{
clangIsCool *c;
std::cout << c->x * 10;
return 0;
}
调用“clang++ test.cpp”没有错误。
然后我使用包控制为 SublimeText2 获得了 SublimeClang。
SublimeClang 可以在这里找到:https ://github.com/quarnster/SublimeClang
在 SublimeText2 中加载“test.cpp”并尝试编译给了我这些错误:
C:/MinGW/include\wctype.h:99,33 - Error - definition of variable with array type needs an explicit size or an initializer
C:/MinGW/lib/gcc/mingw32/4.7.0/include/c++\cwchar:145,11 - Error - no member named 'fgetws' in the global namespace
C:/MinGW/lib/gcc/mingw32/4.7.0/include/c++\cwchar:147,11 - Error - no member named 'fputws' in the global namespace
C:/MinGW/lib/gcc/mingw32/4.7.0/include/c++\cwchar:151,11 - Error - no member named 'getwc' in the global namespace
C:/MinGW/lib/gcc/mingw32/4.7.0/include/c++\cwchar:152,11 - Error - no member named 'getwchar' in the global namespace
C:/MinGW/lib/gcc/mingw32/4.7.0/include/c++\cwchar:157,11 - Error - no member named 'putwc' in the global namespace
C:/MinGW/lib/gcc/mingw32/4.7.0/include/c++\cwchar:158,11 - Error - no member named 'putwchar' in the global namespace
C:/MinGW/include\ctype.h:112,33 - Error - redefinition of '_ctype'
C:/MinGW/include\ctype.h:112,33 - Error - definition of variable with array type needs an explicit size or an initializer
C:/MinGW/include\ctype.h:117,34 - Error - redefinition of '_pctype_dll'
我检查了 SublimeClang 的设置,这是 clang 使用的选项:
"options":
[
"-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/",
"-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1",
"-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/",
"-isystem", "C:\\MinGW\\lib\\gcc\\mingw32\\4.7.0\\include",
"-isystem", "C:\\MinGW\\lib\\gcc\\mingw32\\4.7.0\\include\\c++",
"-isystem", "C:\\MinGW\\lib\\gcc\\mingw32\\4.7.0\\include\\c++\\mingw32",
"-isystem", "C:\\MinGW\\include",
"-Wall"
],
我尝试弄乱包含路径(即使它们看起来对我来说是正确的),但错误仍然存在。
我应该在 SublimeClang 的选项中包含任何其他路径吗?
有没有办法查看默认情况下clang使用的路径(因为它可以从命令行工作),以便我可以将它们与默认的SublimeClang进行比较?