lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It seems that you need this:

extern "C"
{
#include "lua.h"
#include "lualib.h"
}

.paul.

On Tue, Mar 05, 2002 at 01:50:57PM +0100, brian knudsen wrote:
> I've been looking for barebone host apps for implementing LUA using Visual C++, but cant find any at the moment, can anyone help me ?
> 
> 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)
> 
> my simple test : 
> int main()
> {
>  char line[100];
>  
>  lua_State *s=lua_open(1024);
>  lua_dostring(s, line);
>  
>  return 0;
> }
> 
> 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