在Windows上使用clang编译c 11程序时出错
发布时间:2020-11-17 11:18:49 所属栏目:Windows 来源:互联网
导读:我已经在 Windows上构建了clang 3.2并且正在尝试构建一个简单的hello world程序.但是我收到了很多错误,如下所示. d:Mariusxyzclang++ -stdlib=libc++ -std=c++11 -Wall xyz.cpp -o xyz.execlang++: warning: argument unused during compilation: -st
|
我已经在 Windows上构建了clang 3.2并且正在尝试构建一个简单的hello world程序.但是我收到了很多错误,如下所示. d:Mariusxyz>clang++ -stdlib=libc++ -std=c++11 -Wall xyz.cpp -o xyz.exe
clang++: warning: argument unused during compilation: '-stdlib=libc++'
In file included from xyz.cpp:12:
In file included from ./stdafx.h:18:
In file included from C:Program Files (x86)Microsoft Visual Studio 11.0VCincludealgorithm:6:
In file included from C:Program Files (x86)Microsoft Visual Studio 11.0VCincludexmemory:6:
In file included from C:Program Files (x86)Microsoft Visual Studio 11.0VCincludexmemory0:9:
In file included from C:Program Files (x86)Microsoft Visual Studio 11.0VCincludexutility:8:
In file included from C:Program Files (x86)Microsoft Visual Studio 11.0VCincludeutility:8:
C:Program Files (x86)Microsoft Visual Studio 11.0VCincludetype_traits:1072:
33: error:
'_Ty' does not refer to a value
_HAS_TRIVIAL_MOVE_CONSTRUCTOR(_Ty)
^
...
C:Program Files (x86)Microsoft Visual Studio 11.0VCincludexstddef:540:50: note:
expanded from macro '_VARIADIC_EXPAND_4'
#define _VARIADIC_EXPAND_4(FUNC,X1,X2,X3,X4)
^
C:Program Files (x86)Microsoft Visual Studio 11.0VCincludexrefwrap:222:22:note:
expanded from macro '_CLASS_RESULT_OF_PMF_OPT_0X'
__thiscall,X4)
^
fatal error: too many errors emitted,stopping now [-ferror-limit=]
20 errors generated.
我收到很多这样的错误,来自VC 2012标题.是否有可能在Windows上使用clang构建C 11代码?我是否必须提供额外的命令切换? 当由Visual Studio构建时,Clang无法正常工作(据说它可以在由MinGW构建时工作,但我无法自己验证).构建Clang时,它被配置为使用用于构建它的库.由于您使用Visual Studio构建了Clang,因此Clang将尝试使用Visual Studio头文件和库.不幸的是,Clang和Visual Studio的内部结构不同,Clang无法使用特定于VS的标头. 直到libc++可以为Windows编译,Clang将(几乎可以肯定)在Visual Studio编译时不会工作.尝试使用MinGW构建它(并制作博客文章或者你如何做到这一点!),看看它是否适合你. (编辑:南阳站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- JLink重刷固件(win7/win8/win10亲测可用)
- 如何在Windows中挂钩应用程序和进程启动?
- Windows Server 2016-WinSer 2016标准版与数据中心版的区别
- windows – Win32:窗口在整个生命周期内都有相同的HDC吗?
- winapi – 我可以从DLL中删除数字签名吗?
- windows-phone-8.1 – 升级到最新Windows Phone 8.1后无法发
- 06、林信任快捷方式
- 获取Microsoft 10 Edge浏览器Mime类型php
- row_number()在hql中的分区
- windows-8 – 地铁样式Windows 8应用程序是否支持本地数据库
推荐文章
站长推荐
- windows-server-2008 – Windows Server 2008 R2
- macos – 在Windows上使用Tycho构建的Eclipse RC
- windows – 为什么输出传输时某些“for”命令不起
- 如何使用GUI独立于.NET或其他Libs为Windows制作便
- .net – Windows Azure Web角色缓存(预览)“挂起
- windows-runtime – 将Action绑定到XAML中UserCo
- 获取与Windows Vista上的C#.Net连接的无线网络的
- Windows Server 2016-安装AD域服务注意事项
- batch-file – 用于在Windows 7中更改屏幕分辨率
- 使用dll和java jni4net时出现UnsatisfiedLinkErr
热点阅读
