admin管理员组文章数量:1130349
一、下载并安装最新版clang (for windows)
地址:http://www.llvm/releases/download.html
安装时选中添加 LLVM 到 path。
二、编译代码。
有 tmp,内容如下:
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v;
for (int i = 0; i < 5; ++i)
v.push_back(i);
if (1 == 1) {
cout << "This is 1" << endl;
cout << "too many spaces" << endl;
} else {
cout << "haha else!" << endl;
}
cout << "end" << endl;
for (auto &x : v)
cout << &x << ' ';
cout << endl;
for (auto x : v)
cout << &x << ' ';
cout << endl;
}
clang++ -Xclang -flto-visibility-public-std -std=c++14 tmp
或
clang-cl tmp
(参考:https://stackoverflow/questions/42545078/clang-version-5-and-lnk4217-warning)
一、下载并安装最新版clang (for windows)
地址:http://www.llvm/releases/download.html
安装时选中添加 LLVM 到 path。
二、编译代码。
有 tmp,内容如下:
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v;
for (int i = 0; i < 5; ++i)
v.push_back(i);
if (1 == 1) {
cout << "This is 1" << endl;
cout << "too many spaces" << endl;
} else {
cout << "haha else!" << endl;
}
cout << "end" << endl;
for (auto &x : v)
cout << &x << ' ';
cout << endl;
for (auto x : v)
cout << &x << ' ';
cout << endl;
}
clang++ -Xclang -flto-visibility-public-std -std=c++14 tmp
或
clang-cl tmp
(参考:https://stackoverflow/questions/42545078/clang-version-5-and-lnk4217-warning)
版权声明:本文标题:windows安装clang 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1753624399a2585217.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论