Native C++ DLL doesn't work properly with packaged Project

Hi Everybody.
I've a sample game with CryEngine 5.6 to test my native C++ shared library : this library doesn't use ANY CryEngine libraries or functionalities, it's just pure C++.
During the development I've encountered this strange issue, but let's start from the begining.
While developing the game I've linked my solution project with the *.lib of the library and put the *.dll file in the same folder of the MyProject.cryproject file. At this point the library works perfectly and I don't have any issue.
Now I've arrived at a point that I have to pack my game, once I've packaged the game I have to put the *.dll in the MyProject_package/bin/win_x64 (isn't there a way to make this automatically? ) and here I've encountered this strange behaviour: the library result instable, if I start my game multiple time, some time the Game.dll can't load the library.
I have the feeling that the resources allocated by my library aren't released during shutdown, but the stranger thing is that this issue never happens when running the cryproject......
Can somebody tell me how to properly integrate a pure C++ DLL ?
Another question: isn't there any method to overload that handle the game shutdown process ? think that I'm using the First person shooter template.
Thanks :P

Re: Native C++ DLL doesn't work properly with packaged Project

All C++ project are essentially Native Libraries. You will want to make sure that your library is completely ABI compatible by building your DLL with the same compile flags.
You can tell your library the engine is shutting down by capturing the ESYSTEM_EVENT_FULL_SHUTDOWN and ESYSTEM_EVENT_FAST_SHUTDOWN events in a template project system listener who loads the DLL.

You can add a step to you CMakelists.txt to copy the binary from one place to another during compilation, and modify the rcjob files to also copy this when packaging. The RCJob files by default are located at C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.6\Tools\CryVersionSelector\rc_jobs
CRYENGINE Technical Community Manager
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Who is online

Users browsing this forum: No registered users and 2 guests