Search code examples
xcodedependenciesxcode7.1pchoclint

OCLint fails to discover pre-compiled workspace/project headers


I am receiving the error below when attempting to build my OCLint aggregate.

We use pre-compiled headers within the workspace and although they are referenced exactly the same within the main target and OCLint aggregate, for some reason,OCLint aggregate is unable to discover the pch.

This is why the "CocoaLumberjack/CocoaLumberjack.h" dependency can't be found.

I am running Xcode 7.1.1 under OS X 10.11.1

*=== BUILD TARGET [Target] OF PROJECT [Project] WITH CONFIGURATION Debug ===
Check dependencies
ProcessPCH /var/folders/nv/y04q5c5s30567pk7w8lts7zr0000gn/C/com.apple.DeveloperTools/7.1.1-7B1005/Xcode/7.1.1-7B1005/Xcode/SharedPrecompiledHeaders/[Project]-Prefix-canqfypuftycqgglhiqfotrflhkv/[Project]-Prefix.pch.pch [Project]/[Project]-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/.../Dev/Applications/[Project]
    export LANG=en_US.US-ASCII
    export 

PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/.../StaticCodeAnalysis/OBJ-C/OCLint/oclint-0.8.1/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

   :
   :
/Users/.../Dev/Applications/[Project]/[Project]/[Project]-Prefix.pch:16:9: fatal error: 'CocoaLumberjack/CocoaLumberjack.h' file not found
[#import] <CocoaLumberjack/CocoaLumberjack.h>

        ^
1 error generated.
** BUILD FAILED **
[Project]

The following build commands failed:
    ProcessPCH /var/folders/nv/y04q5c5s30567pk7w8lts7zr0000gn/C/com.apple.DeveloperTools/7.1.1-7B1005/Xcode/7.1.1-7B1005/Xcode/SharedPrecompiledHeaders/[Project]-Prefix-canqfypuftycqgglhiqfotrflhkv/[Project]-Prefix.pch.pch [Project]/[Project]-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)*

Solution

  • Update: I was able to solve this problem by issuing the following command:

    xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme