Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCocoapods fails to link some library files #225
Comments
malectro
added
the
bug
label
Feb 2, 2015
Feb 2, 2015
This was referenced
Closed
This comment has been minimized.
This comment has been minimized.
Suz
commented
Feb 20, 2015
I just had this problem with SocketRocket and nothing made sense: the -ObjC flag is there and the libraries are linked, but it was still giving errors. Finally realised that I had added SocketRocket to both my App and to the test target, but I had only linked the App against the library. I was getting the error because the test target also needed to be linked. Duh. |
This comment has been minimized.
This comment has been minimized.
This will be resolved with #288. |
jbwyme
added
the
v2.8.2
label
Jul 16, 2015
This comment has been minimized.
This comment has been minimized.
This should be resolved now if you want to do a |
samgreen
closed this
Jul 17, 2015
This comment has been minimized.
This comment has been minimized.
shaunbruno
commented
Nov 20, 2015
This is not fixed |
This comment has been minimized.
This comment has been minimized.
shaunbruno
commented
Nov 20, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
malectro commentedFeb 2, 2015
In an effort to centralize the conversation about this issue:
The Mixpanel cocoapods is set to link libMPCategoryHelpers.a and libuicore.dylib but sometimes fails to do so during installation. In most cases customers have been successful in manually linking the libs within their projects, but we're currently working on a more better solution.
Edit:
After some digging, it looks like Cocoapods requires the
-ObjC
linker flag (and amends the "Other Linker Flags" Build Setting) upon installation. Though adding-ObjC
flag is the preferred method for loading static libraries with Categories, developers that have fine-tuned library and framework linking can mess up their build process by doing so. This could be why some libraries aren't linking in the first place, but I'm not yet sure.Cocoapods effectively made this a wont-fix with the idea that "frameworks are on the horizon", but it's possible to link each lib manually using the
force_load
tag. For an app using the latest version of Cocoapods (as of 0.35) and Mixpanel 2.7, the Other Linker Flags should look like thisFor apps integrating Mixpanel without Cocoapods, I'd recommend simply adding the
-ObjC
flag, but if this isn't possible, customers can force_load MPCategoryHelpers by adding-force_load $(SRCROOT)/path/to/libMPCategoryHelpers.a
to their linker build settings. (Note that "path/to" is just a placeholder for the path to the lib within the app.)