lua-users home
lua-l archive

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


Make sure to wrap all your Lua includes in extern "C" { }, for instance:

extern "C"
{
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#include <luadebug.h>
}

Matt

-----Original Message-----
From: owner-lua-l@tecgraf.puc-rio.br
[mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of brian knudsen
Sent: Tuesday, March 05, 2002 7:51 AM
To: Multiple recipients of list
Subject: request for barebone MSVC++ host application


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