Xcode 7 handling of include files changed

177 Views Asked by At

Since Xcode 7 came out, I tried to compile and run my game with it, to see the awesome performance boost ;).

The only problem is that apparently the handling of #include files changed in Xcode 7. The best way to explain it would be with an example:

We have an imaginary project with the flowing structure:

  • source_folder
    • main_header.h
    • Utility_code
      • my_class.cpp
      • my_class.h

Now we want to include the main header file in my_class.cpp. In Xcode 6, we would write

#include "main_class.h"

into my_class.cpp and everything would work since the starting point of includes is at the source_folder level.


In Xcode 7, this changed and one would have to write

#include "../main_class.h"

since the starting point is at the same path as our my_class.cpp file.

My project is rather huge and rewriting all includes is not an option. So my question is if someone knows if this is just a setting of Xcode 7 or maybe just a bug?!?!

Your help is much apreciated! Cheers, TK

1

There are 1 best solutions below

0
On BEST ANSWER

There is a setting that should fix your problem. In the Utilities box to the right of the project screen there is an option labeled location. The default is "Relative to Group", changing it to "Relative to Project" should fix your problem. To change it for multiple files at once, you just have to select them all in the Project Navigator and the drop-down box should be available. The location option is the third from the top and the Utilities show/hide button is the top right of the window in Xcode 7.2.