Cocos2d and CocoaAsyncSocket

370 views Asked by At

Please help me fix this problem :

1 - I create a Cocos2d project, add CFNetwork.framework.

2 - I add GCDAsyncUdpSocket.h and GCDAsyncUdpSocket.m from CocoaAsyncSocket library to my project

3 - Built.

---> I have 201 error????? .(although I dont do anything) . I just add GCDAsyncUdpSocket.h and GCDAsyncUdpSocket.m from CocoaAsyncSocket library and built. All errors occur in GCDAsyncUdpSocket.m .

But if I change :

1 - I create a View base app project (not cocos2d project), add CFNetwork.framework.

2 - I add GCDAsyncUdpSocket.h and GCDAsyncUdpSocket.m from CocoaAsyncSocket library to my project

3 - Built.

--->>>It's ok, and I can use GCDAsyncUdpSocket .

How to add CocoaAsyncSocket library (GCDAsyncUdpSocket.h and GCDAsyncUdpSocket.m) for cocos2d project?

Please help me....

1

There are 1 answers

2
sergio On

Check that you are linking CFNetwork.framework with your Cocos2D project.

Another thing you have to fix is related to Cocos2D not supporting ARC (CocoaAsyncSocket is an ARC project, so you have a mismatch). Either you patch your project/Cocos2D base following what this post suggest or you install the latest development brach of Cocos2D (which should fix this).