Hello,
Today I've tried to get Edit & Continue to work in my solution, which looks like this:
Game Engine .lib <- Game .lib <- Editor .exe
<- Server .exe
<- Client .exe
Which works nicely. But now I wanted to turn the engine and game .libs into .dlls, so I can use the Edit & Continue feature of visual studio C++.
So I got a bunch of "__declspec(dllexport)"s in there, etc. works just fine, it runs!
But in certain situations it crashes. Actually, it always crashes in a Lua function that is related to freeing memory.
The engine and the game both work with Lua, they both have their own static C++ interface functions.
I am not certain, but I suppose a .dll is a bit like an .exe without a main function, and each has its own memory somehow. So when for example Game.dll causes Lua to allocate some memory, and Engine.dll causes Lua to free it again, boom! Correct?
Any ideas on how to solve this? Of course Engine.dll should be in charge of Lua, but Game.dll should be able to extend the interface with new static functions.
EDIT: There were no more crashes after I turned Lua itself into a .dll. Before I tried this I also recompiled the statics with the same compiler as all other projects, and I double checked the run time libs, and they are all the same, and I am linking to the right debug/release libs. I am still curious what's going on here.
Have a nice day,
Antoon
P.S. Why don't I have control over returns at Stackoverflow?