keenlabs / KeenClient-iOS

Official iOS client for the Keen IO API. Build analytics features directly into your iOS apps.
https://keen.io/docs
MIT License
78 stars 56 forks source link

Conflicting types for 'localtime' #111

Closed nicholas closed 9 years ago

nicholas commented 9 years ago

Using the Cocoapods version of the KeenClient (3.4.1) with Xcode 6.4 (iOS 8.4) is producing the following errors in keen_io_sqlite3.c:

1) .../Pods/KeenClient/Library/sqlite-amalgamation/keen_io_sqlite3.c:14983:8: Conflicting types for 'localtime' screenshot 2015-07-22 17 20 05

2) .../Pods/KeenClient/Library/sqlite-amalgamation/keen_io_sqlite3.c:15021:13: Definition of 'struct tm' must be imported from module 'Darwin.C.time' before it is required screenshot 2015-07-22 17 20 16

I'm going to swap over to the binary installation method tomorrow to see if that helps, but thought this was worth pointing out.

heitortsergent commented 9 years ago

@nicholas sorry about this error. :(

Did changing over to the binary installation fix it? Do you remember which version of the library you were using?

I just created a blank project and installed the latest version of the library via CocoaPods and don't see any errors.

nicholas commented 9 years ago

Oh no worries. The switch did indeed fix the issue (and we're loving Keen btw!).

I'll give it another shot by tomorrow and get you more details on versions and whatnot.

heitortsergent commented 9 years ago

@nicholas thanks a lot, really appreciate that!

And I'm glad you're loving Keen :dancer:

nicholas commented 9 years ago

Ok, yep, still able to reproduce it. However, not with a brand new project. So it looks like it's something on my end... I'm guessing a conflict with another pod. It's going to take me a bit to dig into it to find out which one, but I'll report back here with my findings.

nicholas commented 9 years ago

Alright, think I got it narrowed down.

I'm using a library that depends on https://github.com/chrisballinger/FFmpeg-iOS. Problem is, that includes a big set of headers, one of which is time.h. Note that it has the same name of the platform provided time header, time.h. So, I'm guessing the FFmpeg time.h gets loaded instead of the one we need. Renaming the FFmpeg time.h to ff_time.h verified that.

In a nutshell, the sqlite amalgamation was calling undeclared time functions.

I think we can safely close this one out - definitely not a Keen issue. :)

heitortsergent commented 9 years ago

I'm glad to hear that @nicholas, thanks for digging into this! :)

nicholas commented 9 years ago

@heitortsergent no problem. Glad I have a fallback with the binary.

And just to add some more context to this for anyone who stumbles here. A similar issue has been discussed over at FFmpeg's tracker. Yay name collisions.

Koshub commented 9 years ago

In XCode in Header Search Path change "recursive" option to "non-recursive"