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

Already on GitHub? Sign in to your account

Library Not Found in Project with Custom Configurations #215

Closed
blakewatters opened this Issue Apr 17, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

blakewatters commented Apr 17, 2012

I have begun wading into leveraging CocoaPods instead of directly adding submodules and building dependencies manually. Prior to the installation of CocoaPods, my project was not a workspace and all libraries were built as explicit dependencies. I tried adding a small library (DCIntrospect) to give it a test drive. The current release version failed out while attempting to add CocoaPods to my project, so I pulled HEAD and installed via 0.6.x development tree.

I was able to get CocoaPods installed and the Pod merged, but upon building the project I encountered a build error that libPods.a could not be found. I monkeyed around with the Scheme editor a bit and noted that the CocoaPods target was not being built, so I added the target to the Scheme and verified that it is being built. The static library builds, as due all my direct dependencies, but when Xcode moves on to linking it fails.

Here is a snapshot of the linker invocation:

Applications/Xcode.app/Contents/Developer/usr/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/blake/Library/Developer/Xcode/DerivedData/GateGuru-gzdheutxkrnetdeggsjcqmpjkwal/Build/Products/Test-iphonesimulator -F/Users/blake/Library/Developer/Xcode/DerivedData/GateGuru-gzdheutxkrnetdeggsjcqmpjkwal/Build/Products/Test-iphonesimulator -filelist /Users/blake/Library/Developer/Xcode/DerivedData/GateGuru-gzdheutxkrnetdeggsjcqmpjkwal/Build/Intermediates/GateGuru.build/Test-iphonesimulator/GateGuru.build/Objects-normal/i386/GateGuru.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lPods -framework CoreText -framework Security -framework CFNetwork -framework CoreLocation -framework MobileCoreServices -framework QuartzCore -framework SystemConfiguration /Users/blake/Library/Developer/Xcode/DerivedData/GateGuru-gzdheutxkrnetdeggsjcqmpjkwal/Build/Products/Release-iphonesimulator/libRestKit.a -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -o /Users/blake/Library/Developer/Xcode/DerivedData/GateGuru-gzdheutxkrnetdeggsjcqmpjkwal/Build/Products/Test-iphonesimulator/GateGuru.app/GateGuru

Note that in this linker invocation there are two external dependencies: CocoaPods and RestKit. The RestKit static library has been expanded to the full path to the built static library, but libPods appears as a -l flag. The project is using custom configurations (Development, Test, Staging, and Production) rather than the standard Debug & Release. This results in external projects that do not have the same configuration names being built on the Release configuration. In my testing, renaming my Development configuration back to Debug fixes the linker error.

I may be able to mitigate this using an explicit library search path, but thought I'd file it as an issue in case anyone else comes across it. We use custom configurations pretty extensively, so this is a speed bump to our adoption

Contributor

blakewatters commented Apr 17, 2012

Add a library search path of $(SYMROOT)/Release$(EFFECTIVE_PLATFORM_NAME) works around the link error

Owner

alloy commented Apr 22, 2012

(Getting up-to-speed again after a conference.)

The current release version failed out while attempting to add CocoaPods to my project, so I pulled HEAD and installed via 0.6.x development tree.

Do you remember what the problem was? Did it have to do with having nested Xcode projects?

The project is using custom configurations (Development, Test, Staging, and Production) rather than the standard Debug & Release. This results in external projects that do not have the same configuration names being built on the Release configuration. In my testing, renaming my Development configuration back to Debug fixes the linker error.

I may be able to mitigate this using an explicit library search path, but thought I'd file it as an issue in case anyone else comes across it. We use custom configurations pretty extensively, so this is a speed bump to our adoption

This is a known issue (#121) that I’m currently working on, the solution will be that you will have to specify the custom configurations in your Podfile and if they should be based on Debug or Release.

Owner

alloy commented May 6, 2012

Closed by 81d3550.

@alloy alloy closed this May 6, 2012

@jzapater jzapater pushed a commit to jzapater/CocoaPods that referenced this issue Sep 17, 2013

@alloy alloy Merge pull request #215 from stigi/Underscore.m
Adding Underscore.m version 0.1.0
8005087
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment