IXWebSocket icon indicating copy to clipboard operation
IXWebSocket copied to clipboard

xcode can't compile ixwebsocket library

Open quannguyen14091986 opened this issue 2 years ago • 2 comments

I tried to put ixwebsocket library in my iOS app project. But xcode failed to compile. It throws an exception

"Undefined symbols for architecture arm64: "ix::initNetSystem()", referenced from: HelloWorld::sayHello() in HelloWorld.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)"

Could you please give me some hint to fix ?

quannguyen14091986 avatar Jun 20 '22 12:06 quannguyen14091986

If I understand the comment in the example correctly, ix::initNetSystem() is only necessary on Windows. Since you are on iOS I would leave it out

StraussDarman07 avatar Jul 11 '22 10:07 StraussDarman07

That's right you don't need to call it on macOS/iOS.

Did you add all source files manually to your xcode project ? If so make sure you added IXNetSystem.cpp to that list.

bsergean avatar Jul 12 '22 21:07 bsergean

ix::initNetSystem() is already a no-op on non windows platform, so if you bring it in to your library say on mac it should compile (even if it isn't needed).

https://github.com/machinezone/IXWebSocket/blob/master/ixwebsocket/IXNetSystem.cpp#L22

Will close this.

bsergean avatar Oct 04 '22 16:10 bsergean