0

What am I not doing correctly?

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)

Im using SKPSMTPMessage from http://skpsmtpmessage.googlecode.com/svn/trunk/SMTPSender/

3 Answers3

0

You're building for the wrong platform. It looks like you're using libraries intended for iphone and then trying to run in the simulator. This code should work if you just run it directly on an iOS device.

The README in the library you're trying to use tells you how to link the library. http://skpsmtpmessage.googlecode.com/svn/trunk/SMTPSender/README.txt

The compiler needs to be told what you're building for - i386/simulator or armv7/iOS device. If you link the library correctly, it will use the parts it's supposed to.

Dustin
  • 6,783
  • 4
  • 36
  • 53
  • I just tried running it on my company's ipad and it still has the same errors – user1489433 Jul 10 '12 at 16:53
  • im trying to go off of what this guy posted http://stackoverflow.com/questions/6284599/mfmailcomposeviewcontroller-question-locking-the-fields – user1489433 Jul 10 '12 at 16:54
  • The iPad does not have an i386 architecture - it uses armv7. You must be incorrectly building onto the iPad. – Dustin Jul 10 '12 at 16:55
  • Have you built an application onto an iOS device before? If you have, do you have any that work right now from your setup? Also iPhone and iPad have the same architecture. – Dustin Jul 10 '12 at 17:08
  • I just tried a different app of mine on the iphone, it runs. Is there any way to fix the architecture to run armv7? – user1489433 Jul 10 '12 at 17:15
  • Well first http://en.wikipedia.org/wiki/Microarchitecture is what architecture is. If you're asking if you can mod the library to run on armv7 if it isn't written for it technically the answer is yes but also the answer is no. I looked at it and it looks like it is made to run on armv7, you just need to link it properly. The reason you were getting problems from i386 is because the library IS built to run on armv7. I updated my answer slightly. – Dustin Jul 10 '12 at 17:18
  • Ok I see now Thank you. Im sorry if I sounded a little confused. – user1489433 Jul 10 '12 at 17:42
0

One common issue with SKPSMTP is forgetting to add a reference to the CFNetwork.framework in your project. Have you added this?

Ian L
  • 5,553
  • 1
  • 22
  • 37
0

I clicked on the MailSend.m file in Project Navigator and set the checkbox near the target name in Target membership of File Inspector.

I found this answer from the link below and copied it almost word for word. With this I was able to continue working in my original project.

Undefined symbols for architecture i386 "_OBJC_CLASS_$_Appirater"

Community
  • 1
  • 1