[iOS Dev] 錯誤訊息 Undefined symbols for architecture i386:

2012-04-12

出現了一堆類似這樣的錯誤

Undefined symbols for architecture i386:

"_OBJC_CLASS_$_SKPSMTPMessage", referenced from:
  objc-class-ref in ConfirmController.o

"_kSKPSMTPPartContentTransferEncodingKey", referenced from:
  -[ConfirmController sendEmail] in ConfirmController.o

"_kSKPSMTPPartMessageKey", referenced from:
  -[ConfirmController sendEmail] in ConfirmController.o

"_kSKPSMTPPartContentTypeKey", referenced from:
  -[ConfirmController sendEmail] in ConfirmController.o

ld: symbol(s) not found for architecture i386

解決的方法為
先點選專案 (左邊navigator列表 點選專案的圖示)
選擇target
選擇頁籤 Build Phases
Compile Sources如果沒展開的話先展開
按加號
將這個target需要的.m檔案都加入吧
(如果只有一個target 就是把所有.m檔案都加入)
這樣應該就可以解決了

會出現這樣的問題
應該是在把.m .h檔案加入到專案裡的時候
Add to targets沒有勾選要加入的target
所以記得加入的時候要勾

ref : http://stackoverflow.com/questions/6984368/undefined-symbols-for-architecture-i386-objc-class-skpsmtpmessage-refere

發表迴響

彙整

分類