0

I'm try to write a small game on IOS using socket and I've had a java socket server running with Flash client, but I got complier errors when I add the AlwaysRightInstitute/SwiftSockets source code to my swift project, and I did nothing after doing this

Here is the project structure:

enter image description here

the selected group "ARISockets" is the source code I drag into my project

and here are the errors(Use of unresolved identifier 'ari_fcntIVi'):

enter image description here

It seems that the errors cause by lack of some import file and I found "ari_fcntIVi" in ARISockets/UnixBridge.c,but I'm a really newer to Swift/Objective-C/C (I'm a AS3 developer), so that sucks me :/

Cœur
  • 37,241
  • 25
  • 195
  • 267
shavy
  • 1
  • 1

2 Answers2

0

I had the same problem with this library. You need to create a Bridge file similar to "Import Objective-C into Swift" but this is C:

How to call Objective-C code from Swift

Community
  • 1
  • 1
Janm
  • 1
0

The issue was that you just copied over the sources instead of embedding the SwiftSockets framework. The ari_ prefixed functions used to required the bridging header of the SwiftSockets framework.

Having said that, the current SwiftSockets doesn't use bridging headers anymore, and you can directly embed the sources.

hnh
  • 13,957
  • 6
  • 30
  • 40