Visual Studio 2015 Update 1,clang错误 [英] Visual Studio 2015 Update 1, clang error

查看:163
本文介绍了Visual Studio 2015 Update 1,clang错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图在我的项目(Visual Studio 2015更新1)中使用Visual Codegen的新俚语,我得到以下错误:

when trying to use new clang with Visual Codegen in my project (Visual Studio 2015 Update 1), I'm getting following error:

clang.exe : error : cannot specify -o when generating multiple output files

只是一个新创建的项目与自动生成的主。

This is just a newly created project with autogenerated main.

我真的不知道该怎么做。

I really don't know what to do about it.

任何帮助赞赏。

推荐答案

这不是很清楚你在做什么,但很明显,在Cross Platform节点中的Clang项目模板。我可以通过使用Win32> Win32项目模板并将项目的平台工具集选择更改为Clang 3.7来重现您的问题。

It is not very clear what you are doing but it seems obvious that you are not using one of the Clang project templates in the Cross Platform node. I can repro your problem by using the Win32 > Win32 Project template and changing the project's Platform Toolset selection to "Clang 3.7".

这不工作,预编译头功能。它不知何故相信它需要编译stdafx.h。不只是一次,它传递给编译器两次。这使得Clang barf出现此错误消息,它一次只接受一个文件。它也不知道如何利用Clang的PCH支持,没有必要的-emit-pch选项的标志。

That doesn't work, it completely flubs the precompiled header feature. It is somehow convinced that it needs to compile stdafx.h. Not just once, it passes it the compiler twice. Which makes Clang barf with this error message, it will only accept one file at a time. It also doesn't know how to take advantage of Clang's PCH support, no sign of the required -emit-pch option.

你需要通过转动功能关闭。项目>属性> C / C ++>预编译头>预编译头=不使用...。选择stdafx.cpp并重复。

You'll need to get ahead by turning the feature off. Project > Properties > C/C++ > Precompiled Headers > Precompiled Header = "Not using...". Select stdafx.cpp and repeat.

这解决了构建问题,最终的可执行程序有点令人惊讶的运行没有问题。应该有点清楚,你在一个从未测试过的场景中使用Clang。看起来IntelliSense解析器也需要更多的工作。 Afaik Clang支持目标是Android和iOS,目前的版本是alpha质量。

That solves the build problem, the final executable somewhat surprising runs without issue. It should be somewhat clear that you are using Clang in a scenario that was never tested by Microsoft. Looks like the IntelliSense parser is going to need a lot more work as well. Afaik Clang support was intended to target Android and iOS, current version is alpha quality.

这篇关于Visual Studio 2015 Update 1,clang错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆