Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
360 views
in Technique[技术] by (71.8m points)

iphone - Up to date instructions on how to install XMPPFramework manually?

I'm having a really tough time getting XMPPFramework to work. I've followed every direction written on the net, and XCode is not finding any of my XMPPFramework classes.

Expected specifier-qualifier-list before 'XMPPStream' XMPP.h: No such file or directory XMPPRoster.h: No such file or directory

I have XMPPFramework copied into my project's root directory. Why can't these files be seen? Is there something that I need to do under Header Search Paths or Library Search Paths?

I've set those entries to $(inherited) and $(SRCROOT) and XCode 4.2 auto-fills in my project's root directory and still doesn't find my files.

I'm quite sure that I'm not the only one having this issue, and it is a showstopper. Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The wiki on github is out of date. Here is how I installed XMPPFramework manually.

Step 1

Clone the XMPPFramework repository to somewhere on your machine and drag the needed folders in somewhere/XMPPFramework to your Xcode project.

The necessary folders are:

  • Vendor/CocoaAsyncSocket
  • Vendor/CocoaLumberjack
  • Vendor/KissXML
  • Vendor/libidn
  • Authentication
  • Categories
  • Core
  • Utilities

You may also need Extensions, it's optional though.

It's important to select the checkbox/radio buttons exactly like this image when dragging folders to your Xcode:

enter image description here

Step 2

a) Drag Sample_XMPPFramework.h to your Xcode and select the checkbox/radio buttons like step 1

b) rename it to XMPPFramework.h

c) customize the content of XMPPFramework.h based on your needs. (I didn't change anything)

The file structure should look like this in Xcode project navigator after doing step 1 and 2:

enter image description here

Step 3

link following frameworks and libraries

  • CFNetwork.framework
  • Security.framework
  • libxml2.dylib
  • libresolv.dylib
  • libidn.a

enter image description here

Step 4

Added these 2 lines to Build Settings:

  • other linker flags = -lxml2 enter image description here
  • HEADER SEARCH PATHS = /usr/include/libxml2 enter image description here

You should be good after these 4 steps. However, please notice that you usually need to #import <UIKit/UIKit.h> before using XMPPFramework


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...