Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDLog compile errors in command-line tool targets #311

Closed
snej opened this issue Apr 3, 2015 · 2 comments
Closed

DDLog compile errors in command-line tool targets #311

snej opened this issue Apr 3, 2015 · 2 comments

Comments

@snej
Copy link

snej commented Apr 3, 2015

Added GCDAsyncSocket to a brand new command-line-tool project in Xcode 6.3 and got compile errors in DDLog.m — it's referencing AppKit symbols NSApp and NSApplication but doesn't #import AppKit headers; apparently it assumes the target prefix header will have imported these already.

At a higher level, this code is assuming that any non-iOS target will be linked against AppKit, which isn't true for many non-GUI programs. (And such programs shouldn't be linked with AppKit if it's not necessary, because that ends up creating WindowServer connections that increase startup time and memory usage.)

/Couchbase/BLIPSync/vendor/WebSockets-Cocoa/vendor/CocoaAsyncSocket/Vendor/CocoaLumberjack/DDLog.m:158:13: error: use of undeclared identifier 'NSApp'
        if (NSApp)
            ^
/Couchbase/BLIPSync/vendor/WebSockets-Cocoa/vendor/CocoaAsyncSocket/Vendor/CocoaLumberjack/DDLog.m:911:19: error: use of undeclared identifier 'NSApplication'; did you mean 'cApplication'?
                [[NSApplication sharedApplication] respondsToSelector:@selector(occlusionState)] // OS X 10.9+
                  ^~~~~~~~~~~~~
                  cApplication
...
@snej
Copy link
Author

snej commented Apr 3, 2015

Looks like this has been fixed for a while in the CocoaLumberjack repo — the offending code is now conditionalized with #ifdef NSAppKitVersionNumber10_0. Could you please update the copy included in CocoaAsyncSocket?

@github-actions
Copy link

This issue has been marked as stale, it will be closed automatically if there is no further activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant