Jump to content

  • Log In with Google      Sign In   
  • Create Account


Visual C++ and LUA


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Sardaukar   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 March 2002 - 01:35 AM

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

Sponsor:

#2 Kylotan   Moderators   -  Reputation: 3324

Like
Likes
Like

Posted 05 March 2002 - 02:38 AM

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 ]

#3 Sardaukar   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 March 2002 - 03:29 AM

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





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS