1

I'm using the Crashlytics CLS_LOG macro throughout my project. It's working everywhere except in one class, where I get Implicit declaration of function 'CLS_LOG' is invalid in C99. If I comment out the calls in that one class then the entire project compiles fine.

I'm including Crashlytics in my prefix.pch like this:

#ifdef __OBJC__
    // Other imports
    #import "Crashlytics/Crashlytics.h"
    // Other imports
#endif

I've trying clearing pre-compiled headers, reinstalling the Crashlytics framework, and more - nothing has helped.

Any idea what could be breaking the macro in a single class?

dwb
  • 799
  • 5
  • 14
  • Did you try to `#import "Crashlytics/Crashlytics.h"` directly in your class? – Maxim Pavlov Feb 23 '15 at 12:56
  • @MaksimPavlov Thanks, I did. If I do `#import "Crashlytics/Crashlytics.h"` I get *'Crashlytics/Crashlytics.h' file not found*. If I do `#import "Crashlytics.h"` I get *Undefined symbols for architecture x86_64: "_CLSNSLog", referenced from: ... not found for architecture x86_64* – dwb Feb 23 '15 at 13:59

1 Answers1

3

I figured it out.

The problem was that I had added this class to the compiled sources for a new target (a widget), but I hadn't added the Crashlytics framework to that target.

I also followed the instructions from this answer to create a prefix.pch for the widget target, added Crashlytics to that, and now everything is compiling as expected.

Community
  • 1
  • 1
dwb
  • 799
  • 5
  • 14