   I'm trying to embed LUA and then bring universal peace
  Hi,I hope I'll find guidance her cause I'm trying to embed lua 5.0 into a project for days - without much sucess.I'm not at the binding process - everything i want to do is call a lua script (plain or optcode) which says "Hello world!".I've managed to do it at a little standalone "project".extern "C"{#include "lua.h"#include "lualib.h"#include "lauxlib.h"}main(){//do the lua stuff{lua_State* luaVM = lua_open();if (luaVM != NULL){luaopen_base(luaVM);luaopen_string(luaVM);luaopen_math(luaVM);luaopen_io(luaVM);lua_dofile(luaVM, "luatest.lub");lua_close(luaVM);}}  It works. I'm making the same adjusments to my project (header, libs and the rest of this code). And? It doesn't work.It compiles with a lot of warnings (192) - all the same, for example:lua.lib(lvm.obj) : warning LNK4006: _luaV_settable already defined in lualib.lib(lvm.obj); second definition ignored  But a least it compiles - and then I'm getting runtime exceptions when trying to call lua_dofile()- (Unhandled Exception - Access violation writing location 0x00000010). I've used the LuaBuild-5.0 files and Build my own. No significant differnce.Then I've kept close to the GameDev Tutorial "An Introduction to Lua" and tried the dostring code exactly as said. It works partially.The odd thing is: I can call lua-scripts as long I'm not doing anything to "interact" with the app.For exmaple...   char* strLuaInput = "a = 1 + 1;\n";lua_dostring(luaVM, strLuaInput);    ...works. But when I'm trying to write at the console:char* strLuaInput = "a = 1 + 1;\nprint( a);\n";lua_dostring(luaVM, strLuaInput);    I'm getting an Exception (access violation - writing location ...)I've guessed that the dofile/dostring functions are somewhat "old" cause the documentation of lua 5.0 says nothing about them. But I also couldn't find out how I should simply call a script and not with "lua_dofile()".I've begun from scratch serveral times - no sucess. Has anyone an idea what am I doing wrong?thanx[edited by - quasty on February 16, 2004 11:53:04 AM]
  The LNK4006 error code suggests that you''re using two versions of the same object (lvm.obj, for one). I''m no Lua expert, but I suspect that lualib.lib is a static link library while lua.lib is a static import library for a DLL. Consult your documentation and correct as necessary. ;  thanx, that helped a bit. The warnings are gone - but no chance in the behaviour of the app. hmm - strange.I''m still getting these §$&$&/ exeptions when calling dofile/dostring.But wait: what dll? Can I switch from a lua5 static libary to a dll? I havn''t found any? Maybe there is something wrong with the LIBs (on the other hand - used my own builds and the ones from luabuild; no difference).Does somebody know a good source for tutorials on this part? The lua documentation is a bit *strange* to read; i''ve problems getting stuff out of it which I can use. Most things about lua I''ve read in the gamedev article and this forum.thanx;  You need to compile your LUA library with the same "runtime library" settings as you''ll use in your project.For example, if your project uses "static single-threaded debug" runtime library for the debug config, you need to link the debug config against a library compiled with that same setting. If it''s compiled with another setting, the libraries will clash and you will crash.;  Yes!Thanks man - everything is working perfectly now! Great - but now I''ve to handle the universal peace thing But the thing is: I''ve read this hint once and must have realised it wrong.again: thank you very much. 