I’m using LUA for a SDL project. I downloaded the precompiled LIB and DLL file from here (http://sourceforge.net/projects/luabinaries/files/5.2/Windows%20Libraries/Dynamic/) (lua-5.2_Win32_dll10_lib.zip) and have incorporated it into my project. When I build a debug build the application runs 100% fine. When I set it to release mode and press the Play button in Visual Studio it also runs fine.
BUT if I run the Release file by doubling clicking it in the folder I get the error c0000005 with the lua52.dll.
I’m running MicroSoft Visual C++ 2010 Express.
I went through deleting lines till it started working and the lines that causes the error are.
void aiBrainmanager::run(string holdData){
int errfunc = 0;
int s;
int s = luaL_loadstring(L, holdData.c_str());
if ( s==0 ) {
s = lua_pcall(L, 0, LUA_MULTRET, errfunc);
}
if (errfunc !=0) {
}
if (s !=0) {
aiBrainmanager::target->stopWorking();
}
}
Any idea what setting is wrong or how to fix it.
0xc0000005 is a memory violation. The fact that it works in debug, means a number possible things.
Looking at your code I would look at:
Why are you checking for error and then not doing anything?????
I think you’ll find you’re getting a LUA_ERRMEM