aharren / LibComponentLogging-Core

A small logging library for Objective-C applications (Mac OS X and iPhone OS/iOS) which provides conditional logging based on log levels and log components. Additionally, different logging strategies can be used, e.g. writing log messages to a file or sending them to the system log, while using the same logging interface.
http://0xc0.de/LibComponentLogging
110 stars 11 forks source link

code indexer in Xcode throwing errors #23

Closed otusweb closed 6 months ago

otusweb commented 10 years ago

When i build my project, i don't have any errors, but as soon as the compile is over, i have a few errors pop up. ie: /Users/olivier/Documents/elektra/src/elektra/elektra/ELEFetchedResultsViewControllerWithTableView.m:42:13: Implicit declaration of function 'lcl_log' is invalid in C99 /Users/olivier/Documents/elektra/src/elektra/elektra/ELEFetchedResultsViewControllerWithTableView.m:42:21: Use of undeclared identifier 'lcl_cCoreData' /Users/olivier/Documents/elektra/src/elektra/elektra/capture/ELEAddItemViewController.m:238:5: Implicit declaration of function 'lcl_log' is invalid in C99 /Users/olivier/Documents/elektra/src/elektra/elektra/capture/ELEAddItemViewController.m:238:13: Use of undeclared identifier 'lcl_cDeviceManagement'

Given that it compiles, and runs i can see that everything works, but i'd like to be able to get rid of those warning. Happy to give more details, but i'm not sure what is relevant

aharren commented 10 years ago

Hi,

which Xcode version are you using?

Have you installed LibComponentLogging via CocoaPods, or manually via copying it into your project?

Best regards, Arne

otusweb commented 10 years ago

5.0.2

aharren commented 10 years ago

Hi,

that's the same version I currently use.

In which file do you include the lcl.h file?

Is it possible to create a very small Xcode project which shows the problem and which you can share?

Best regards, Arne

otusweb commented 10 years ago

lcl.h is included in the prefix.pch file

#ifdef __OBJC__
    #import <CoreData/CoreData.h>
    #import <Foundation/Foundation.h>
    #import <MobileCoreServices/MobileCoreServices.h>
    #import <SystemConfiguration/SystemConfiguration.h>
    #import <UIKit/UIKit.h>

    #import "lcl.h"
#endif

I'll look into creating a small project reproving the issue

aharren commented 10 years ago

Perhaps there's a target which doesn't use the prefix.pch file?

otusweb commented 10 years ago

I do have two targets (one for the app and one for unit test), both use the same .pch file apparently, could that be the issue? I'll try creating another pch file that does not import lcl.h

aharren commented 10 years ago

I have a similar configuration at https://github.com/aharren/CardDecks/tree/3.0, the app and the unit tests both use the same .pch file.

aharren commented 10 years ago

@otusweb any update here?

otusweb commented 10 years ago

Sorry, no update. I still see it happening, but have not been able to narrow down the conditions