SocketIOClient-Unreal icon indicating copy to clipboard operation
SocketIOClient-Unreal copied to clipboard

ASIO library version conflict with Unreal 5.3

Open paul-foster opened this issue 1 year ago • 2 comments

If you enable the StateTree plugin in Unreal 5.3, it includes a new StateTree Debugging feature which depends on a TraceAnalysis module in Unreal. This TraceAnalysis module in Unreal depends on Asio.

We get a linker error if we try to build 5.3 with both the StateTree Plugin enabled and the SocketIOClient-Unreal plugin because SocketIOClient-Unreal uses Asio.

To fix this and make SocketIOClient-Unreal work with Unreal 5.3 (when using StateTrees), you need to use the same version of Asio that Unreal is using.

paul-foster avatar Jan 31 '24 10:01 paul-foster

It looks like Unreal 5.3 is using version 1.12.1. In Unreal: Engine/Source/ThirdParty/asio/1.12.2/asio

paul-foster avatar Jan 31 '24 10:01 paul-foster

likely can be alleviated with some variant of a namespace wrapping, something similar was done for rapidjson: https://github.com/getnamo/rapidjson/commit/25e68d7d6d5252a7917497d3e02eb4ed59e183f7

getnamo avatar Jan 31 '24 10:01 getnamo

I was able to get something to work by doing a massive find & replace for the asio namespace for something else (asio_sockio). I couldn't think of a clever way that didn't end up modifying each individual file. It seems rapidjson already had the hooks in for this issue but asio doesn't (at least that I could find).

Here's the commit to my fork, which refers to the other respective ThirdParty forks: https://github.com/RedwoodMMO/SocketIOClient-Unreal/commit/d51bb748dbce3d93148b63df0e91e451952ef9ae

If you're interested in this approach @getnamo, I can put together a few PRs

EDIT: Actually, I need to update a couple more conflicts (i.e. asio_signal_handler) before it'll fully package for me. I will update yall when it's finally packaging.

mikeseese avatar Mar 27 '24 05:03 mikeseese

Alright, I force pushed a new commit (https://github.com/RedwoodMMO/SocketIOClient-Unreal/commit/d51bb748dbce3d93148b63df0e91e451952ef9ae) that uses an additional asio commit. I'm only replacing things that I get linker errors for when packaging the Lyra template, which is due to depending on the TraceAnalysis module somewhere from the Lyra project. There may be more conflicts that aren't showing up, but I'm able to package for both WIndows and Linux platforms 🤷

mikeseese avatar Mar 28 '24 17:03 mikeseese