我正在尝试在ios应用程序中重用一个代码。该代码有几个mac和ios框架。我不知道哪个文件是针对mac os的,哪个是针对ios的,所以我将所有内容都包含在新项目中,包括框架,但是我收到了应用程序服务框架的错误。我知道Application Services框架仅适用于MAC OS而不适用于ios。但是如果我从我的项目中删除ApplicationServices框架,那么它会产生更多错误,因为它正在某些类中使用。这是我的错误日志
ld /Users/Library/Developer/Xcode/DerivedData/FlacPlayerUniversal-bupfypehvcjbrofyhhjbqudwhdre/Build/Products/Debug-iphonesimulator/FlacPlayerUniversal.app/FlacPlayerUniversal normal i386
cd "/Users/Documents/ios5 Examples/FlacPlayerUniversal"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/Library/Developer/Xcode/DerivedData/FlacPlayerUniversal-bupfypehvcjbrofyhhjbqudwhdre/Build/Products/Debug-iphonesimulator "-L/Users/Documents/ios5 Examples/FlacPlayerUniversal/opt/iphone-4.3/lib" "-L/Users/Documents/ios5 Examples/FlacPlayerUniversal/opt/iphone-simulator-4.3/lib" -F/Users/Library/Developer/Xcode/DerivedData/FlacPlayerUniversal-bupfypehvcjbrofyhhjbqudwhdre/Build/Products/Debug-iphonesimulator "-F/Users/Documents/ios5 Examples/FlacPlayerUniversal" -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -filelist /Users/Library/Developer/Xcode/DerivedData/FlacPlayerUniversal-bupfypehvcjbrofyhhjbqudwhdre/Build/Intermediates/FlacPlayerUniversal.build/Debug-iphonesimulator/FlacPlayerUniversal.build/Objects-normal/i386/FlacPlayerUniversal.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework CoreGraphics -framework ApplicationServices -framework Accelerate -framework CoreFoundation -framework CFNetwork -framework AudioToolbox -framework CoreAudio -framework UIKit -framework Foundation -lFLAC++ -lFLAC -lmpg123 -logg -lsndfile -lspeex -lspeexdsp -lvorbis -lvorbisenc -lvorbisfile -lwavpack -lFLAC++ -lFLAC -lmpg123 -logg -lsndfile -lspeex -lspeexdsp -lvorbis -lvorbisenc -lvorbisfile -lwavpack -o /Users/Library/Developer/Xcode/DerivedData/FlacPlayerUniversal-bupfypehvcjbrofyhhjbqudwhdre/Build/Products/Debug-iphonesimulator/FlacPlayerUniversal.app/FlacPlayerUniversal
ld: framework not found ApplicationServices
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ failed with exit code 1
请帮助解决此错误。
答案 0 :(得分:3)
OS X和iOS具有相似但不相同的框架。您应该删除任何依赖于iOS X不可用的OS X框架的内容。
答案 1 :(得分:2)
iOS上没有ApplicationServices框架。因此,您需要修改框架,以便它不会尝试链接到iOS变体的ApplicationServices框架。因此,在编译iOS时,它也可能不会尝试调用任何Mac OS X特定功能或引用任何Mac OS X特定符号。没有其他方法可以使它工作。