Can't compile old project after upgrade to Xcode 9/10 : "Expected unqualified-id" Error in GLKit / common.h

341 Views Asked by At

I have a IOS project I need to update. It works fine in Xcode 8, but after upgrading to Xcode 9 or 10 (tried both) it won't compile anymore.

I get "Expected unqualified-id" parse error in the file "common.h" which is included from GLKit.h.

The line with the error is the following:

} /* extern "C" */

I think perhaps a } to much, however I can't even edit this file as it belongs to apples libraries and is read only.

If I go back to Xcode 8 it immediately works again.

1

There are 1 best solutions below

0
Kermit On

I found out what happened. I had the following somewhere:

#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))

This messed up with something in the common.h.

Defining this after the include of the common.h solved the problem. I dont know why this only happens on XCode 9+