タコさんブログ

プログラミングメモと小言

ParseUI iOSでハマった

ParseUIをGitからクローンしてきて、Build from Sourceに書いてあるとおりParseUIDemoを試してみたけど、下のようなエラーがでて、コンパイルできない。

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC 
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lsqlite3
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lsqlite3 is not an object file (not allowed in a library)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lz
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lz is not an object file (not allowed in a library)

解決策はissues#3に書いてあるとおり、Pods-ParseUI.debug.xcconfigを下のように書き換える。

OTHER_LDFLAGS = -ObjC -l"Pods-ParseUI-Bolts" -l"Pods-ParseUI-Facebook-iOS-SDK" -l"Pods-ParseUI-Parse" -l"Pods-ParseUI-ParseFacebookUtils" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreLocation" -framework "MobileCoreServices" -framework "Parse" -framework "ParseFacebookUtils" -framework "QuartzCore" -framework "Security" -framework "StoreKit" -framework  "SystemConfiguration" -weak_framework "Accounts" -weak_framework "AudioToolbox" -weak_framework "CoreGraphics" -weak_framework "CoreLocation" -weak_framework "Foundation" -weak_framework "QuartzCore" -weak_framework "Security" -weak_framework "Social" -weak_framework "UIKit"

また、Pods-ParseUIDemo.debug.xcconfigも同じように書き換える。

OTHER_LDFLAGS = -ObjC -l"Pods-ParseUIDemo-Parse" -l"Pods-ParseUIDemo-ParseFacebookUtils" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreLocation" -framework "MobileCoreServices" -framework "Parse" -framework "ParseFacebookUtils" -framework "QuartzCore" -framework "Security" -framework "StoreKit" -framework "SystemConfiguration" -weak_framework "Accounts" -weak_framework "AudioToolbox" -weak_framework "CoreGraphics" -weak_framework "CoreLocation" -weak_framework "Foundation" -weak_framework "QuartzCore" -weak_framework "Security" -weak_framework "Social" -weak_framework "UIKit"

これでコンパイルが通った。