# LNK2019 errors when using Socket.IO classes.

**URL:** <https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893>\
**Category:** Community & Industry Discussion\
**Tags:** socket, library, unreal-engine, linking, static, question, linking-error\
**Created:** [May 8, 2015, 12:48pm UTC](https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893 "2015-05-08T12:48:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JRavilo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JRavilo\_1](https://forums.unrealengine.com/u/JRavilo_1)\
**Post date:** [May 8, 2015, 12:48pm UTC](https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893/1 "2015-05-08T12:48:31Z")

</div>

So I’m attempting to link [Socket.IO](http://Socket.IO) C++ Client to UE for connection purposes. I’m trying to follow these two setup guides [GitHub - socketio/socket.io-client-cpp: C++11 implementation of Socket.IO client](https://github.com/socketio/socket.io-client-cpp) (for [socket.io](http://socket.io)) and [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System),

so far, when in the VS editor, the [Socket.IO](http://Socket.IO) classes show up with no problem. Even autocomplete seems to work properly. As soon as I build, I encounter the following errors:

Error 2 error LNK2019: unresolved external symbol “public: \_\_cdecl sio::client::client(void)” (??0client@sio@@QEAA@XZ) referenced in function “public: \_\_cdecl ATest::ATest(class FObjectInitializer const &)” (??0ATest@@QEAA@AEBVFObjectInitializer@@@Z) C:\Users\User\Documents\Unreal Projects\Cards\Intermediate\ProjectFiles\Test.cpp.obj Cards

Error 3 error LNK2019: unresolved external symbol “public: \_\_cdecl sio::client::~client(void)” (??1client@sio@@QEAA@XZ) referenced in function “public: \_\_cdecl std::unique\_ptr\<class sio::client,struct std::default\_delete \>::~unique\_ptr\<class sio::client,struct std::default\_delete \>(void)” (??1?$unique\_ptr@Vclient@sio@@U?$default\_delete@Vclient@sio@@@std@@@std@@QEAA@XZ) C:\Users\User\Documents\Unreal Projects\Cards\Intermediate\ProjectFiles\Test.cpp.obj Cards

Error 4 error LNK2001: unresolved external symbol “public: \_\_cdecl sio::client::~client(void)” (??1client@sio@@QEAA@XZ) C:\Users\User\Documents\Unreal Projects\Cards\Intermediate\ProjectFiles\Cards.generated.cpp.obj Cards

Error 5 error LNK2019: unresolved external symbol “public: class std::shared\_ptr const & \_\_cdecl sio::client::socket(class std::basic\_string\<char,struct std::char\_traits,class std::allocator \> const &)” (?socket@client@sio@@QEAAAEBV?$shared\_ptr@Vsocket@sio@@@std@@AEBV?$basic\_string@DU?$char\_traits@D@std@@anonymous_user_e71e0d8a?$allocator@D@2@@4@@Z) referenced in function “public: \_\_cdecl ATest::ATest(class FObjectInitializer const &)” (??0ATest@@QEAA@AEBVFObjectInitializer@@@Z) C:\Users\User\Documents\Unreal Projects\Cards\Intermediate\ProjectFiles\Test.cpp.obj Cards

Error 6 error LNK1120: 3 unresolved externals C:\Users\User\Documents\Unreal Projects\Cards\Binaries\Win64\UE4Editor-Cards.dll Cards

Error 7 error : Failed to produce item: C:\Users\User\Documents\Unreal Projects\Cards\Binaries\Win64\UE4Editor-Cards.dll C:\Users\User\Documents\Unreal Projects\Cards\Intermediate\ProjectFiles\ERROR Cards

Error 8 error MSB3073: The command ““C:\Program Files\Unreal Engine\4.7\Engine\Build\BatchFiles\Build.bat” CardsEditor Win64 Development “C:\Users\User\Documents\Unreal Projects\Cards\Cards.uproject” -rocket” exited with code -1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets 38 5 Cards

I seem to be unable to access any of the sio::client class members. Does this mean I failed to link the library propery? Has anyone encountered a problem similar to this?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [May 8, 2015, 1:41pm UTC](https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893/2 "2015-05-08T13:41:50Z")

</div>

It means linker don’t see .lib files of [Socket.IO](http://Socket.IO) in order to link your code to library, you did something wrong in build script. Also you are aware that UE4 got it’s own Socket API which you can use?

> **[FSocket](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Sockets/FSocket/)**
>
> This is our abstract base class that hides the platform specific socket implementation

---

<div class="post-metadata">

**Author:** ![JRavilo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JRavilo\_1](https://forums.unrealengine.com/u/JRavilo_1)\
**Post date:** [May 11, 2015, 3:21am UTC](https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893/3 "2015-05-11T03:21:03Z")

</div>

I see. I’m going to investigate if I can use FSocket client-side and [Socket.IO](http://Socket.IO) server-side(is it possible?). Thanks for pointing this out.

---

<div class="post-metadata">

**Author:** ![Azarus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Azarus](https://forums.unrealengine.com/u/Azarus)\
**Post date:** [May 11, 2015, 8:30am UTC](https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893/4 "2015-05-11T08:30:40Z")

</div>

FSocket is useful for networking UDP/TCP and other protocols.

[Socket.IO](http://Socket.IO) uses Websockets or uses ajax if websocket is not avaliable. If you want to use FSocket you have to implement almost everything you need to use [socket.io](http://socket.io) on server side…  
I assume you want to use NopeJS, in this case i would recommend to keep going with c++ and [Socket.IO](http://Socket.IO).

Also the engine already has Websocket Support.

> **[Is websocket found from current ue 4 libraries?](https://forums.unrealengine.com/questions/98154/is-websocket-found-from-current-ue-4-libraries.html)**
>
> This would be handy with HTML5 too.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [May 12, 2015, 1:24am UTC](https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893/5 "2015-05-12T01:24:53Z")

</div>

Well i didn’t know WebSocket has something more in to it, i just thouth is socket support for JS 😛 On link you gave it only said engine libwebsocket, but there no proper UE4 APIs made which would use HTTP module and FSocket to work with it. I think cleanest implementation in UE4 would be use of HTTP module and FSocket if that possible, or even extend classes that they provide to make it work, From what i read websockets is normal socket communication just under HTTP server supervision.

Also on an ote ajax is JS APIs thing which allows to do extra HTTP requests on background

---

<div class="post-metadata">

**Author:** ![JRavilo\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JRavilo\_1](https://forums.unrealengine.com/u/JRavilo_1)\
**Post date:** [May 12, 2015, 3:32am UTC](https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893/6 "2015-05-12T03:32:10Z")

</div>

Update: I used another method to build the [socket.io](http://socket.io) library(cmake then build solution : [GitHub - socketio/socket.io-client-cpp: C++11 implementation of Socket.IO client](https://github.com/socketio/socket.io-client-cpp)). I had to build boost(one of the [Socket.IO](http://Socket.IO) dependencies) for 64-bit before building the actual [Socket.IO](http://Socket.IO) C++ lib, again for 64-bit. I then used the same steps for linking it according to [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System) and it seems to be working now.

---

<div class="post-metadata">

**Author:** ![Azarus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Azarus](https://forums.unrealengine.com/u/Azarus)\
**Post date:** [May 12, 2015, 7:30am UTC](https://forums.unrealengine.com/t/lnk2019-errors-when-using-socket-io-classes/317893/7 "2015-05-12T07:30:21Z")

</div>

The [Socket.IO](http://Socket.IO) uses multiple protocols it is different than the standard web-socket, It’s rather a wrapper. But all of them start with a single http request.
