• Advertisement

Archived

This topic is now archived and is closed to further replies.

Visual C++ and LUA

This topic is 5799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 ]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement