2012-12-16 49 views
0

嘗試使用ImageIO框架從圖像準備元數據(例如,kCGImagePropertyExifBodySerialNumberkCGImagePropertyExifLensModel)。不幸的是在編譯鏈接ImageIO鏈接器錯誤?

有一個煩惱:

Undefined symbols for architecture x86_64: 
"_kCGImagePropertyExifBodySerialNumber", referenced from: 
     -[AppDelegate applicationDidFinishLaunching:] in AppDelegate.o 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

ImageIO/CGImageProperties.h是進口corurse,並ImageIO.framework包括在目標配置列表中的「鏈接的框架和庫」上。

只有當我嘗試使用kCGImagePropertyExifBodySerialNumberkCGImagePropertyExifLensModel時纔會發生。同樣的項目kCGImagePropertyExifFocalLength,kCGImagePropertyExifExposureTime使用沒有任何問題

任何想法?

回答

0

這些常量似乎沒有在ImageIO框架的SDK版本中定義。你可以自己用以下命令檢查:(編輯路徑的Xcode如適用)

nm /Volumes/Applications/Developer\ Tools/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/imageio | grep -F kCGImagePropertyExifBodySerialNumber 

我是獅子機上的那一刻,和相同的框架的系統版本確實有它:

% nm /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/imageio | grep -F kCGImagePropertyExifBodySerialNumber 
00000000000e4898 s _kCGImagePropertyExifBodySerialNumber 

所以,我建議filing a bug然後,作爲一種解決方法,在項目的構建設置解封SDKROOT(「基地SDK」)。在沒有設置SDK的情況下,它應該使用您正在構建的系統的框架和標題。

該解決方法的缺點是,如果您使用的是Mountain Lion上引入的任何內容,則無法在Lion上構建。

+0

符號既不是10.7 SDK也不是10.8 SDK,但在系統庫(我正在運行10.8.2)中可以找到。 – maseth