Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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


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 don't 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?

like image 468
Jvinniec Avatar asked Oct 02 '17 14:10

Jvinniec


1 Answers

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

enter image description here

like image 155
safat siddiqui Avatar answered Nov 19 '22 16:11

safat siddiqui