2012-07-10 113 views
0

我没有正确地做什么?SKPSMTP消息错误'未定义符号'

Undefined symbols for architecture i386: 
    "_OBJC_CLASS_$_SKPSMTPMessage", referenced from: 
    objc-class-ref in MailSend.o 
    "_kSKPSMTPPartContentTransferEncodingKey", referenced from: 
    -[MailSend sendEmail] in MailSend.o 
    "_kSKPSMTPPartContentTypeKey", referenced from: 
    -[MailSend sendEmail] in MailSend.o 
    "_kSKPSMTPPartMessageKey", referenced from: 
    -[MailSend sendEmail] in MailSend.o 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

进出口使用SKPSMTPMessage从http://skpsmtpmessage.googlecode.com/svn/trunk/SMTPSender/

回答

0

您正在为错误的平台。它看起来像你正在使用专门用于iPhone的库,然后尝试在模拟器中运行。如果您只是直接在iOS设备上运行该代码,该代码应该可以正常工作。

您尝试使用的库中的自述文件告诉您如何链接库。 http://skpsmtpmessage.googlecode.com/svn/trunk/SMTPSender/README.txt

编译器需要告诉你正在为什么构建 - i386/simulator或armv7/iOS设备。如果您正确链接库,它将使用它应有的部分。

+0

我只是想对我公司的iPad上运行它,它仍然有同样的错误 – user1489433 2012-07-10 16:53:35

+0

IM试图熄灭的这家伙张贴http://stackoverflow.com/questions/6284599/mfmailcomposeviewcontroller-question -locking-the-fields – user1489433 2012-07-10 16:54:00

+0

iPad没有i386架构 - 它使用armv7。您必须错误地构建到iPad上。 – Dustin 2012-07-10 16:55:41

0

SKPSMTP的一个常见问题是忘记在项目中添加对CFNetwork.framework的引用。你有没有添加这个?

+0

我将CFNetwork/CFNetwork.h导入到我的.h文件中,并且我仍然有相同的错误 – user1489433 2012-07-10 16:55:03

+0

并且CFNetwork框架被添加到我的项目中 – user1489433 2012-07-10 16:56:41

+0

这与Dustin声明的结构必须是相关的......我已经只是将文件添加到一个新的项目,它编译好。 – 2012-07-10 17:04:59