adding smartFoxClient to an iphone project

Post here all your questions related with the SmartFoxServer iPhone API

Moderators: Lapo, Bax

roocell
Posts: 29
Joined: 10 Jun 2009, 20:12

adding smartFoxClient to an iphone project

Postby roocell » 15 Jun 2009, 23:35

It would be great if someone could provide a step by step process to add this to your iphone project. wrt build flags, adding frameworks, etc

here's what i have so far

1. drag the Source and Header folders into your project.
2. add libxml to your project by modifying the project build settings.
- other linker flags add "-lxml2"
- search paths, header search paths add "/usr/include/libxml2" recursive

3. ?
4. ?

i'm stuck with a linker errors _CFStreamCreatePairWithSocketToCFHost and _CFHostCreateWithName referenced from NStreamAddition.o

can anyone help?
User avatar
cemuzunlar
Posts: 47
Joined: 26 Dec 2008, 00:45
Contact:

Postby cemuzunlar » 16 Jun 2009, 07:32

You need to add CFNetwork.framework to you projects linked libraries:

Open XCode->Project->Edit Active Target

Press the + link under the Linked libraries
Select CFNetwork.framework and click Add and you are done.
Cem Uzunlar
Infosfer Game and Visualization Technologies
http://www.infosfer.com
contact@infosfer.com
roocell
Posts: 29
Joined: 10 Jun 2009, 20:12

Postby roocell » 17 Jun 2009, 13:27

thanks that worked!
Marcelo Emmerich
Posts: 2
Joined: 09 May 2010, 12:41
Location: Germany
Contact:

Postby Marcelo Emmerich » 09 May 2010, 12:45

roocell wrote:thanks that worked!


Just in case, I also had to manually add libxml to the project. I wrote up a small tutorial on this here: http://www.em-motion.mobi/?p=126.

Cheers,

Marcelo
Marcelo Emmerich
http://www.em-motion.mobi
User avatar
cemuzunlar
Posts: 47
Joined: 26 Dec 2008, 00:45
Contact:

Postby cemuzunlar » 12 May 2010, 11:44

Marcelo, thanks for the tutorial!
Cem Uzunlar

Infosfer Game and Visualization Technologies

http://www.infosfer.com

contact@infosfer.com
intomo
Posts: 22
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

Having trouble with SDK 4.2

Postby intomo » 21 Dec 2010, 01:19

I have added the paths in the tutorial substituting iPhoneOS4.2.sdk where appropriate and the build is not finding the library and won't compile.

Here is my Header Search Path
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/libxml2
Here is my Frameworks Search Path
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include

Can you tell me what I'm doing wrong.
I did add the CFNetwork framework.
I'm trying to run the RC4 example and it will not compile.

I can't use a previous SDK because 4.2 is the current one.

Thanks in advance.
intomo
Posts: 22
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

Postby intomo » 11 Jan 2011, 00:32

Okay.
Found the problem.
When I removed the Framework Search Path all was ok.

What worked for me is to follow the above instructions.
Add the CFNetwork Framework.
Add Header Search Paths
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/libxml2
Add Library Search Paths
Same as above
Add the Other Linker flag -lxml2

I got it to compile fine in 4.2.
kewur
Posts: 1
Joined: 10 Jul 2011, 23:42
Location: Istanbul

Postby kewur » 10 Jul 2011, 23:52

Hello,

I was having this problem and even though I tried everything that was said here I still had the problem. I solved it after some thinking and am posting this for future users to find.

If you are using Facebook Connect with your application ( or any other application that uses same librarys, in my case that was JSON) you need to delete one of them from the included projects. or you will have a linker error (duplicate)

obvious but may be helpful.

Return to “iPhone Objective-C API”

Who is online

Users browsing this forum: No registered users and 3 guests