Visual C++ and LUA

Started by
1 comment, last by Sardaukar 22 years, 2 months ago
Can anyone help me get this fine language implemented in a barebone app ? what i want is something no more advanced than this: int main() { char line[100]; lua_State *s=lua_open(1024); lua_dostring(s, line); return 0; } I seem todo something wrong, as i get linking errors (undefined reference to lua functions) .. I have added "LibLua.lib" + "LibLuaLib.lib" to my list of objects to link (these are precompiled binaries for static linked lua) the error: linking... TestWithScript.obj : error LNK2001: unresolved external symbol "int __cdecl lua_dostring(struct lua_State *,char const *)" (?lua_dostring@@YAHPAUlua_State@@PBD@Z) TestWithScript.obj : error LNK2001: unresolved external symbol "struct lua_State * __cdecl lua_open(int)" (?lua_open@@YAPAUlua_State@@H@Z) Does anyone have a clue what im doing wrong ? I would be gratefull if you would send a barebone LUA app with static linked libraries, but suggestions are very welcome .. anything to get this fine languaging working in my apps!!! best regards Brian Knudsen .... a sudden strike fan - www.suddenstrike.dk
....a sudden strike fan - www.suddenstrike.dk
Advertisement
Ok, if you''re compiling a .CPP file, it expects to find C++ functions, but the Lua headers are for C. Enclose the #include "lua.h" (or whatever Lua includes you use) in an extern "C" { includes here... } block, and try again.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]
already forgot about this posting out of happyness .. i just found out about the extern thingy a few mins ago .. thx!



....
a sudden strike fan - www.suddenstrike.dk
....a sudden strike fan - www.suddenstrike.dk

This topic is closed to new replies.

Advertisement