XCode 9: “clang: error: cannot specify -o when generating multiple output files”

本小妞迷上赌 提交于 2020-01-12 08:01:12

问题


I've just updated xcode to version 9 and I've started getting the following error message when compiling:

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

The issue seems to be linked to compiling with the "Optimization Level" parameter set to "None" (i.e. -O0). If I set this higher the error goes away, BUT when I increase the optimization the debugging tools do not work appropriately (for example variable tracking).

I've looked at other questions that list this error, but they either involve some kind of duplicate '-isystem' or dont involve xcode at all.

I'm currently compiling a program using an external clang downloaded via macports (port clang-5.0) in order to debug using openmp (which does not come with the default clang shipped with mac os).

Any suggestions?


回答1:


I was getting the same error when trying to enable OpenMP in Xcode 9.

Finally able to fix the problem by changing some Xcode 9 settings found from this:

In build settings > build options > Enable Index-While-Building Functionality to No



来源:https://stackoverflow.com/questions/46527662/xcode-9-clang-error-cannot-specify-o-when-generating-multiple-output-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!