clang.exe:错误:生成多个输出文件时无法指定-o [英] clang.exe : error : cannot specify -o when generating multiple output files

查看:474
本文介绍了clang.exe:错误:生成多个输出文件时无法指定-o的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试使用clang编译项目,但收到此错误:


        clang.exe:错误:生成多个输出文件时无法指定-o


我正在使用VS 2017 15.5.1。该项目使用的是Microsoft的主编译器,我只是将其改为使用:


        Visual Studio 2017 - 与Microsoft CodeGen一起使用(v141_clang_c2)


似乎主编译器的某些设置为clang提供了无效值...


请帮忙吗?


Juan





Juan Dent

解决方案

嗨Juan,


感谢您发布此处。


>>我正在尝试使用clang编译项目,但收到此错误:


        clang.exe:错误:生成多个输出文件时无法指定-o


请提供有关项目的详细信息。


您是否检查了项目属性中的输出文件属性 - >链接器?或者您是否尝试在项目属性中禁用预编译头文件> c / c ++ - >预编译头文件属性?


当您同时编译.cpp文件和标题时,编译器无法决定产生预编译头或可执行文件的原因。


顺便说一下,为了更好地支持clang编译器,我建议你在下面的页面上发帖。 / p>

https://clang.llvm.org/


<希望这可以帮到你。


最好的问候,


Baron Bi



Hi,

I am trying to compile a project with clang but get this error:

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

I am using VS 2017 15.5.1. The project was using Microsoft's main compiler and I just changed it to use:

       Visual Studio 2017 - Clang with Microsoft CodeGen (v141_clang_c2)

Seems some setting from main compiler is giving an invalid value to clang...

Any help please?

Juan


Juan Dent

解决方案

Hi Juan,

thanks for posting here.

>>I am trying to compile a project with clang but get this error:

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

Please provide more information about your project.

Have you checked the Output File property in your project property->Linker? Or have you tried to disable precompiled headers in your project property->c/c++->Precompiled headers property?

It seems when you compile .cpp file and header at the same time, the compiler couldn't decide what produce as output precompiled headers, or executable file.

By the way, for better support of clang compilers, I suggest you post on this page below.

https://clang.llvm.org/

Hope this could be help of you.

Best Regards,

Baron Bi


这篇关于clang.exe:错误:生成多个输出文件时无法指定-o的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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