因為在 iOS 上有 wav to flac 轉檔的需求,所以在網絡上找到這個 framework / wav_to_flac,按照他文件的步驟 build 完後,將產生的 FLACiOS.framework 丟到需要使用的 project 中,但都出現下面這找不到 framework 的 error

clang: error: linker command failed with exit code 1 (use -v to see invocation)

找了一下會出現這 error 有可能是 xcode5 bug 造成的,因此用了下面這設定方式修改了「Library Search Paths」的路徑

(P.S. 中間刪刪減減修改很多次,除了每次 build 前都要 clean 一下,另外多出來的 framework path 也要記得去清掉,build setting  裡的 Library Search Paths 和 Framework Search Paths)


試過很久後,還是不 work,就上網去問了,其中有網友回報他 build (include ogg version) 是成功的(與我 build no ogg 版本不同),以下是他的步驟:

  1. git clone https://github.com/jhurt/FLACiOS/tree/no-ogg
  2. project 加入 build 好的 ogg.framework
  3. 把 FLACiOS.framework 複製到 project 下的 Library
  4. 在 Build Settings 的 Framework Search Paths 增加${SRCROOT}/Library
  5. 在 Build Phases 的 Link Binary With Libraries 加入 FLACiOS.framework (第四步驟可以省略,但在別的機器跑就要加進去~ 因為加 framework 是寫絕對路徑~)

看了他的 project 設定與我的並沒有不同,差異只在於 build framwork 的版本不同,拉了他的 framework (include ogg) 到我的 project 就成功了,過陣子有時間再 recheck 看看到底真正問題是什麼,目前就先用他 build 出來的 framework 來用了 😛