Lots of warnings when building with Xcode 7 with 3rd party libraries

I am getting a large number of warnings when compiling my project in Xcode 7 GM (bitcode is NOT enabled) in regards to third party static libraries. Xcode is complaining about "No such file or directory" or "Could not resolve external type". All of this used to work perfectly, the only changes made were an updated version of the library and the use of Xcode 7 GM.


This seems to be happening with many other people as well, as it can be seen here: http://sensiblecocoa.com/community/topic/2344-warnings-with-stv-500-and-xcode-7-beta-5/


Here is a sample list of warnings:


(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Foundation-3DFYNEBRQSXST.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Foundation-3DFYNEBRQSXST.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/ObjectiveC-1RQA2RIXJIE19.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/ObjectiveC-1RQA2RIXJIE19.pcm: No object file for requested architecture

(null): warning: Could not resolve external type c:objc(cs)NSString

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Social-N94D31PLFESQ.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Social-N94D31PLFESQ.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Accounts-V2GNZG08D26T.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Accounts-V2GNZG08D26T.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/CoreLocation-2RB9TGORWT0YQ.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/CoreLocation-2RB9TGORWT0YQ.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/UIKit-1V5UHAPTOD24G.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/UIKit-1V5UHAPTOD24G.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/CoreGraphics-N94D31PLFESQ.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/CoreGraphics-N94D31PLFESQ.pcm: No object file for requested architecture

(null): warning: Could not resolve external type c:objc(cs)NSObject

(null): warning: Could not resolve external type c:objc(cs)ACAccountStore

(null): warning: Could not resolve external type c:objc(cs)NSMutableArray

(null): warning: Could not resolve external type c:objc(cs)NSError

(null): warning: Could not resolve external type c:objc(cs)NSURL

(null): warning: Could not resolve external type c:objc(cs)NSURLRequest

(null): warning: Could not resolve external type c:objc(cs)NSURLResponse

(null): warning: Could not resolve external type c:objc(cs)NSData

(null): warning: Could not resolve external type c:objc(cs)NSDictionary

(null): warning: Could not resolve external type c:objc(cs)ACAccountType

(null): warning: Could not resolve external type c:objc(cs)NSMutableDictionary

(null): warning: Could not resolve external type c:objc(cs)ACAccount

(null): warning: Could not resolve external type c:objc(cs)NSNotification

(null): warning: Could not resolve external type c:objc(cs)NSPredicate

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/SystemConfiguration-354UAJE49HRJF.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/SystemConfiguration-354UAJE49HRJF.pcm: No object file for requested architecture

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Darwin-38I6DLZ5IH61J.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/Darwin-38I6DLZ5IH61J.pcm: No object file for requested architecture

(null): warning: Could not resolve external type c:objc(cs)NSNumber

(null): warning: Could not resolve external type c:objc(cs)NSArray

(null): warning: Could not resolve external type c:objc(cs)NSDate

(null): warning: Could not resolve external type c:objc(cs)UIApplication

(null): warning: Could not resolve external type c:objc(cs)UIDevice

(null): warning: Could not resolve external type c:objc(cs)NSLocale

(null): warning: Could not resolve external type c:objc(cs)NSBundle

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/MachO-1BMJAO5Q3NM3O.pcm: No such file or directory

(null): warning: /var/folders/p4/z7zy68r92hd3p5ry5g2v3k_8rlwzzr/C/org.llvm.clang.dalmo/ModuleCache/1TXZDLI9N2EMV/MachO-1BMJAO5Q3NM3O.pcm: No object file for requested architecture

Accepted Reply

The solution that finally worked for me was a combination of the partial solutions pointed out by BrettThePark and Adrian Prantl (big thanks).


  • Precompile Prefix (GCC_PRECOMPILE_PREFIX_HEADER) = NO
  • Debug Information Format (DEBUG_INFORMATION_FORMAT) = DWARF with dSYM
  • Enabled Modules (C and Objective-C) (CLANG_ENABLE_MODULES) = NO


After that the warnings no longer appear and all else behaves as expected.

Replies

This thread may have a solution


https://forums.developer.apple.com/message/47932#47932

After trying all the solution posted previously, I have found one that appears to work for the static library I work with.


- This is what I needed to change to Off to remove all the warnings

Precompile Prefix (Header GCC_PRECOMPILE_PREFIX_HEADER) = off


- Many people disussed that dysm had to be turned off, I believe it is working with it enabled

Debug Information Format (DEBUG_INFORMATION_FORMAT) = dwarf-with-dsym


- Since the enable bitcode is really to enable markers, we can just turn it off to remove warnings

Enable Bitcode (ENABLE_BITCODE) = NO


- This flag is needed to all builds will actually embed the bitcode

Other C Flags (OTHER_CFLAGS) = "-fembed-bitcode";

Regarding PLCrashReporter, I had a similar issue as yours. I downloaded the code and compiled the framework with bitcode enabled. I have not yet tried to submit the update version, but it should not present that problem anyway. For that matter, before executing the library to create a framework and instead trying to compile it directly I also got huge number of errors and warning. Please check if that is also your issue. You may alaso want to check the StackOverflow thread were I was suggested this solution:

http://stackoverflow.com/questions/32525916/xcode-7-crashreporter-does-not-contain-bitcode-linker-error

When building a library for distributing to other machines, it is important to turn off the clang option -gmodules (respecitvely the Xcode setting CLANG_ENABLE_MODULE_DEBUGGING).


(The Xcode documentation for CLANG_ENABLE_MODULE_DEBUGGING says:

“Use the shared debug info available in clang modules. Results in smaller build artifacts, faster compile times, and more complete debug info. This should only be disabled when building static libraries with debug info for distribution.”)


-- adrian

It works

Disabling CLANG_ENABLE_MODULES was definetly required before my static libs stopped throwing warnings... Hella annoying.

Is this issue resolved? Changing "Debug Information Format" to "DWARF" silents the warnings but it also disables symbolics and breaks Crashlytics. Any good solution so far?

When building a library for distribution to other machines, CLANG_ENABLE_MODULES should be disabled and dSYM creation should be enabled.

Hi,


Where exactly do you go to disable CLANG_ENABLE_MODULES and enable dSYM creation in xCode? Any help to point me there will be greatly appreciated it, I have been trying to get rid of these warnings for a long time now.


Also, if these warnings don't go away. Will Apple still accept the App for to publish on the App Store?


Thanks!

The solution that finally worked for me was a combination of the partial solutions pointed out by BrettThePark and Adrian Prantl (big thanks).


  • Precompile Prefix (GCC_PRECOMPILE_PREFIX_HEADER) = NO
  • Debug Information Format (DEBUG_INFORMATION_FORMAT) = DWARF with dSYM
  • Enabled Modules (C and Objective-C) (CLANG_ENABLE_MODULES) = NO


After that the warnings no longer appear and all else behaves as expected.

Note that once you disabled module debugging (CLANG_ENABLE_MODULES = NO) turning on clang modules or precompiled headers should work fine for static libraries. If it doesn't, please file a bug report so we can investiagte what's going on there.

But once I set CLANG_ENABLE_MODULES = NO, I will get complie error such as

Undefined symbols for architecture x86_64: "_vImageBoxConvolve_ARGB8888"

Because I used Objective-C code, for example UIImage+ImageEffects, and it uses frameworks like #import <Accelerate/Accelerate.h>


Anyone help on how to deal with this? Thanks!

This may be because the extension of libraries changed from .dylib to .tbd with Xcode 7. Try removing your old libraries and re-inserting them with the new "flavor".


I had similar errors with C++ and once I removed libc++.dylib and replaced it with libc++.tbd, everything worked fine again.

Hi, I disabled module debugging (CLANG_ENABLE_MODULE_DEBUGGING = NO), but could still reproduce this problem. Only by disabling modules entirely (CLANG_ENABLE_MODULES) was I able to get rid of the warnings. I filed rdar://22978324 with a sample project and built libraries reproducing this issue (the open radar version is here: https://openradar.appspot.com/radar?id=5051031360634880 for other people wanting to check it out).

In our case, we publish the library. Our clients were seeing this issue until we turned off "Precompile Prefix Header" in the targets.