在編譯的時候編譯失敗,並且查詢錯誤訊息:duplicate symbols for architecture arm64
於是我到專案→Target→Build Phases→Complie Source 卻沒有重複的 .m檔,我將過去的專案設定做比對,發現 Build Setting 的 No common blocks 與先前的專案設定不一樣,改為 No 便可以編譯通過。
Apple Quick Help 解釋 No common blocks:
|
Declaration:
GCC_NO_COMMON_BLOCKS
|
|
|
|
Description:
In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without extern ) in two different compilations, you will get an error when you link them. [GCC_NO_COMMON_BLOCKS, -fno-common]
|

