-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build DLL with the same STL library as Unreal #27
Comments
Its not safe for the stl types, its going to be a mixture of padding/packing/optimization levels. I attempted at one point to get the cmake compile options used in the engine build to match the library builds, but the way Epic structured the build tools most of it is private and unreachable from the public interface. I think I might be able to support it though C#'s reflection of the private fields but I have not had a chance to test it (and really try to limit my exposure to C# :) ) |
Digging in I think the issue was that my library was linked against the debug MSVCP library. When I switched to the release library everything works. As far as I can tell this should be fairly safe since the DLL is where the alignment comes into play, so as long as both are using the same one we should be in good shape. Ultimately though the safest would be for this to just be built directly as part of the Unreal Build Tool, would be interesting to think about how we could use this plugin to work that way. Thanks for the great plugin! |
I just want to say, I blame you for my recent pain. I think I might have something working, it uses the reflection api to pull out most (maybe all) of the flags from the toolchains. I have not tested it on Windows but seems to work on Linux, (although fastnoise2 with the rtti options is giving me a lot of trouble, as UE does not like rtti) |
It does seem to fetch the cxx_flags, that I then inject into cmake
|
I'm trying to understand some issues I'm seeing using STL types in a dll built with UE4CMake. I know that in general it's not recommended to use STL types with a DLL, but I assumed that UE4CMake would remedy this by making sure the toolchain, compilers, etc. were all aligned. However I'm finding that the DLL and code in Unreal have very different ideas of how the STL types are laid out.
Is this caused by the DLL pointing at a different library or would this be another issue like the 4-byte packing issue? I can just bring the whole project into my Plugins folder, but I'm hoping to keep this library somewhat separate.
The text was updated successfully, but these errors were encountered: