簡體   English   中英

iPhone靜態庫分發和發布版本錯誤(但不適用於調試)

[英]iPhone static library distribution and release build errors (but not for debug)

更新資料

丹尼爾(Daniel)很近,那不是搜索路徑。 在GCC 4.2下的Prefix Header設置為:$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h

當我梳理前2次時,我錯過了這一點。 我將其刪除,現在一切正常。


原始問題

我已經使用/構建帶有靜態庫的產品大約一個星期了,沒有任何問題。

第一次,我嘗試進行發行版本構建(用於臨時測試),到處都是錯誤。

這些錯誤奇怪地說,它找不到Appkit標頭。 這很奇怪,因為它是一個iPhone應用程序,不應鏈接到Appkit標頭

另外,當我從調試切換到發行/發行時,庫名稱“ libFJSCodeDebug.a”變為紅色。 我認為這一定是一個大提示。

為了進行測試,我復制了調試配置並將其重命名為release。 這建得很好。 因此看來問題出在配置中。 以下是構建時在Xcode中獲得的內容的摘要。 (注意:我將我的目標命名為FJSCodeDebug,即使它將用於調試和發布版本)

Building target “FJSCodeDebug” of project “FJSCode” with configuration “Release” — (169 errors)
    Checking Dependencies
        cd /[redacted]/FJSCode
    setenv PATH "/DeveloperBeta/Platforms/iPhoneOS.platform/Developer/usr/bin:/DeveloperBeta/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /DeveloperBeta/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -x objective-c-header -arch armv6 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -Wreturn-type -Wunused-variable -isysroot /DeveloperBeta/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk -gdwarf-2 -mthumb -miphoneos-version-min=3.0 -iquote /[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/FJSCodeDebug-generated-files.hmap -I/[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/FJSCodeDebug-own-target-headers.hmap -I/[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/FJSCodeDebug-all-target-headers.hmap -iquote /U[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/FJSCodeDebug-project-headers.hmap -F/[redacted]/build/Release-iphoneos -I/[redacted]/build/Release-iphoneos/include -I/Users/coreyfloyd/Xcode/ProductionProjects/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/DerivedSources/armv6 -I/[redacted]/build/FJSCode.build/Release-iphoneos/FJSCodeDebug.build/DerivedSources -c /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h -o /var/folders/R+/R+ofDLtuH1GOYQ1ZQ2C5mk+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/AppKit-gihvhjsfuggoevbehiszhgrzcska/AppKit.h.gch
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:11:33: error: AppKit/AppKitDefines.h: No such file or directory
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:12:32: error: AppKit/AppKitErrors.h: No such file or directory
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:13:37: error: AppKit/NSGraphicsContext.h: No such file or directory
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:14:35: error: AppKit/NSAccessibility.h: No such file or directory
/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15:32: error: AppKit/NSActionCell.h: No such file or directory

...... (continues for everything in AppKit)......


Build failed (169 errors)

我正在尋找2個解決方案中的1個:顯然,修復發布版本以不出現這些錯誤,或者調整調試配置以具有發布配置所需的所有重要設置。

有任何想法嗎??

這個

-c /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h

使我相信您的構建目標出於某種原因(盡管我認為它根本不應該這樣做)正在嘗試編譯AppKit.h,並且/或者它在錯誤的位置(例如,在根目錄中/系統,而不是SDK / Developer / Platforms / ...)。

您應該仔細檢查構建設置庫/框架搜索路徑,並且AppKit.h不在編譯階段。

您的項目是否包括Mac OS產品? 您確定您沒有在框架組中意外包含Mac庫/框架嗎?

在SDK2.2.1中,我不知道為什么,但是總是讓我困惑的是當“ Active SDK”和“ Active Executable”不同步時(在構建配置下拉列表中)。 這會導致奇怪的鏈接器錯誤,其中iPhone嘗試針對其庫動態鏈接。 每當我從調試/發行版或設備/模擬器切換時,此設置似乎有時就會不同步。

也許是類似的情況,如果不查看實際項目設置就很難分辨。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM