是否可以仅在Windows上使用Clang编译C ++
Is it possible to compile c++ using Clang only on windows?
我真的尝试了很多。Clang没有附带标准的C++包含,显然找不到它们:
clang++ file.cpp -o file.out
C:Folderfile.cpp:1:11: fatal error: 'iostream' file not found
#include <iostream>
^
1 error generated.
通过参数传递 mingw 包含,它会返回另一个错误:
clang++ -target x86_64-w64-mingw32 C:Folderfile.cpp -IC:MinGWmingw64libgccx86_64-w64-mingw326.3.0includec++ -IC:MinGWmingw64libgccx86_64-w64-mingw326.3.0includec++x86_64-w64-mingw32 -IC:MinGWmingw64x86_64-w64-mingw32include -o C:Folderfile.out -std=c++11
clang++.exe: error: unable to execute command: program not executable
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
当我使用-c
时,它不使用链接器,也不会生成可执行文件。
编辑:我在窗口上运行
从"VS 2017 的 x64 本机工具命令提示符"或类似内容运行命令。它将为您设置一些所需的环境变量。
相关文章:
- 通过自制软件(macOS)安装的clang++:编译错误
- 在使用 Clang 编译 DLL 时指定 DEF 文件
- constexpr 使用 clang 编译 TensorFlow 时出错
- clang编译的程序在std::any_cast期间抛出std::bad_any_cast
- 使用 Android NDK 使用 clang++ 编译C++代码时对"_Unwind_Resume"的未定义引用
- 为什么这段代码无法使用 gcc 4.8.5 编译,而使用 clang 编译正常
- 向 cppFlags 添加"-O0"无法禁用 Android Studio 中的 clang 编译优化
- C++汇编代码分析(使用 clang 编译)
- 为什么以下代码不使用GCC编译,而是用Clang编译罚款
- clang编译错误与static_assert和boost :: hana有关
- clang 编译模板类,并在标题中实现
- 在Windows上使用clang编译CUDA时的重新定义
- 如何在OSX上为clang编译 #include < 实验/任意>
- constexpr 唯一 ID,使用 clang 编译,但不使用 GCC 编译
- 是否可以仅在Windows上使用Clang编译C ++
- 当我用clang编译代码时,GCOV会出现内存错误
- 在MacOS上使用gcc-8而不是clang编译Qt5
- 如何使用 clang 编译特殊的数学函数
- 使用 gcc 编译和使用 clang 编译代码时未定义的引用
- 使用clang编译时regex-segfault,可能存在编译器错误