I’ve spent many days struggling with crashes and the following error every time I tried to run my project (both editor or game build) with external lib:
"The game module ‘myGameTest’ could not be loaded. There may be an operating system error or the module may not be properly set up"
I’ve checked every step of the linkage procedure. The project compiles successfully on Visual Studio and there are copies of the DLLs in the required folders… I’m on Windows 10.
Today I got my hands on a Windows 8.1 PC with same UE4 version and tried to run the same project. I just made a copy of the project folder to the other machine with the same UE4 version and… it worked flawlessly! I’ve even built the project again on that machine and made changes on code to run some tests and didn’t get any single problem…
Then I tried to place the same copy of the project on a fresh Windows 10 PC just to make sure it wasn’t some weird issue on the first machine itself. And it didn’t run again… So I can just conclude that DLL linkage is causing crashes under Windows 10 for some reason here… Both Windows 8.1 and 10 are 64bits version.
The library itself is working fine on Windows 10, I’ve tested it on non-UE4 projects and it works.
Does anyone have any idea about the cause of that? I can’t format my main machine and install Windows 8.1 again just because of this issue…
Ps; I’ve tried this on both 4.8 and 4.9 UE4 versions.
You need to load it manually, follow the next code from the physics system and how it loads the PhysX DLL’s.
The code is located in: Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysXLibs.cpp
I don’t get it… I’ll need to create a cpp file like that to load the external library somehow? I thought that was only necessary if I’m including the external library as a new module… I’m currently loading the includes and libs via myProject.Build.cs as explained here A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums
I created a ThirdParty folder inside my project folder and put the libraries in there, properly organizing and linking them on myProject.Build.cs. Then I copied the DLL to the Binaries folder (inside my project) and it works fine on Windows 8. But it won’t work on Windows 10…
If there is a reason for that and now the only way to include external libs on Windows 10 is creating a new module, I’ll do it. But I have no idea on how to turn the library into those modules with cpp and all those labels… Is there a tutorial about that somewhere?
ps: the library I’m trying to use is SimpleAmqpClient and rabbitmq-c
That can’t help me either, but thanks…
I’m not trying to migrate code between projects. I just can’t get the very same project that runs fine on Windows 8 to run on Windows 10 too… And I think the cause is somehow the external lib linking because when I remove its usage from code, the project runs fine on both Windows 8 and 10.
As I can use it on Win8, it has to be related to Windows version… But it is looking like a bug already. I’d like to find someone that has successfully run the same project on Win8 and Win10 while using external dynamic libs…