Xcode 7 beta: error while importing XCTest

I'm trying to build an existing project with Xcode 7 beta (7A120f) and my unit tests target fails to build.


Here's the error message:


While building module 'XCTest' imported from /Users/maksym.grebenets/Projects/ffx/ci-workspace/mobile-lib-fmcore/FMCoreTests/FMDispatchTests.m:5:
In file included from <module-includes>:1:
In file included from /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h:32:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestDefines.h:51:6: error: '__OBJC_GC__' is not defined, evaluates to 0 [-Werror,-Wundef]
#if !__OBJC_GC__ && __OBJC2__
     ^
1 error generated.
/Users/maksym.grebenets/Projects/ffx/ci-workspace/mobile-lib-fmcore/FMCoreTests/FMDispatchTests.m:5:9: fatal error: could not build module 'XCTest'
@import XCTest;
~~~~~~~^~~~~~
2 errors generated.


It doesn't matter for which target I build.


P.S. I wanted to post to related Xcode 7 beta place, but couldn't find any.

For those who have this issue, it is due to -Wundef flag being enabled.


I'm not sure it could be called a fix but it will help you to get over the proglem. It could be Xcode 7 beta problem and could probably be fixed with final release.

Xcode 7 beta: error while importing XCTest
 
 
Q