0

I'm trying to use SocketRocket for an iOS project, I'm developing... I've been going by the instructions on Socket Rocket - Installing iOS and using the provided chat example as a guide, but when I use:

_webSocket = [[SRWebSocket alloc] initWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"ws://localhost:9000/chat"]]];

It throws two Mach-O Linker error:

1: "_OBJC_CLASS_$_SRWebSocket", referenced from: Objc-class-ref in HTViewController.o Symbol(s) not found for architecture i386

2: Linker command failed with exit code 1 (use -v to see invocation)

As far as I can tell, I've included the correct frameworks/dylibs (as mentioned on the GitHub) and I've added -ObjC to the "other linker flags" option... Any ideas what I might be missing?

user969043
  • 756
  • 2
  • 13
  • 34

1 Answers1

0

You must build the SRWebSocket library with i386 architecture.

You can avoid these kind of erros by using package manager like Cocoapods for XCode. They also have SRWebSocket library in SocketRocket package.

EDIT:

If that version is not what you want, you can fork the Cocoapods Specs repository and upgrade the Pod to latest SocketRocket version.

Then you can also add your forked repo to your local Cocoapods installation using pod repo command.

Ahmed Al Hafoudh
  • 8,281
  • 1
  • 18
  • 34
  • I tried using the SocketRocket I could find on Cocoapods (SocketRocket 0.2.0, found by searching on Cocoapods), but seems like it might be an old version, as it not ARC-"ified" and has deprecated functions... – user969043 Jan 07 '13 at 22:27