lua-users home
lua-l archive

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


We use LUA script to let users to customize our server software written in C++.

At the moment we are porting the 32 bits Windows version of our project to Visual Studio 2010.
Once everything works fine with VS 2008, we thought that we would have no problem on upgrade process.

Unfortunately whenever we tried to link the lualib (as dll) to our project in VS 2010, the lua functions could not be found anymore by the linker (the error messages are displayed below). 

It seems that some calling convention is wrong on 2010, like the application may be looking for the lua functions with a prefix '_'.

To access lua functions (written in C) from our project modules (C++) we use this:

extern "C" {
#include "lua/src/lua.h"
#include "lua/src/lualib.h"
#include "lua/src/lauxlib.h"
}

The same project compiles and links with lualib successfully on VS 2008 and Linux (g++).


Could anybody help me with this ?


1>dscscript.obj : error LNK2019: unresolved external symbol __imp__luaL_openlibs referenced in function "public: int __thiscall DsCScriptEngine::Init(void)" (?Init@DsCScriptEngine@@QAEHXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__luaL_newstate referenced in function "public: int __thiscall DsCScriptEngine::Init(void)" (?Init@DsCScriptEngine@@QAEHXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_close referenced in function "public: void __thiscall DsCScriptEngine::Shutdown(void)" (?Shutdown@DsCScriptEngine@@QAEXXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_pcall referenced in function "public: long __thiscall DsCScriptEngine::Execute(char const *)" (?Execute@DsCScriptEngine@@QAEJPBD@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__luaL_loadfile referenced in function "public: long __thiscall DsCScriptEngine::Execute(char const *)" (?Execute@DsCScriptEngine@@QAEJPBD@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_error referenced in function "public: class DsCScriptValue __thiscall DsCScriptEngine::GetGlobalValue(char const *)" (?GetGlobalValue@DsCScriptEngine@@QAE?AVDsCScriptValue@@PBD@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_pushstring referenced in function "public: class DsCScriptValue __thiscall DsCScriptEngine::GetGlobalValue(char const *)" (?GetGlobalValue@DsCScriptEngine@@QAE?AVDsCScriptValue@@PBD@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__luaL_ref referenced in function "public: class DsCScriptValue __thiscall DsCScriptEngine::GetGlobalValue(char const *)" (?GetGlobalValue@DsCScriptEngine@@QAE?AVDsCScriptValue@@PBD@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_getfield referenced in function "public: class DsCScriptValue __thiscall DsCScriptEngine::GetGlobalValue(char const *)" (?GetGlobalValue@DsCScriptEngine@@QAE?AVDsCScriptValue@@PBD@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_settop referenced in function "public: long __cdecl DsCScriptEngine::CallGlobalFunction(char const *,int,int,...)" (?CallGlobalFunction@DsCScriptEngine@@QAAJPBDHHZZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_pushvalue referenced in function "public: long __cdecl DsCScriptEngine::CallGlobalFunction(char const *,int,int,...)" (?CallGlobalFunction@DsCScriptEngine@@QAAJPBDHHZZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_call referenced in function "public: long __cdecl DsCScriptEngine::CallGlobalFunction(char const *,int,int,...)" (?CallGlobalFunction@DsCScriptEngine@@QAAJPBDHHZZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_rawgeti referenced in function "public: long __cdecl DsCScriptEngine::CallGlobalFunction(char const *,int,int,...)" (?CallGlobalFunction@DsCScriptEngine@@QAAJPBDHHZZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_type referenced in function "public: long __cdecl DsCScriptEngine::CallGlobalFunction(char const *,int,int,...)" (?CallGlobalFunction@DsCScriptEngine@@QAAJPBDHHZZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_createtable referenced in function "public: __thiscall DsCScriptTableValue::DsCScriptTableValue(class DsCScriptEngine const &)" (??0DsCScriptTableValue@@QAE@ABVDsCScriptEngine@@@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_rawseti referenced in function "public: void __thiscall DsCScriptTableValue::AddValue(class DsCScriptValue &)" (?AddValue@DsCScriptTableValue@@QAEXAAVDsCScriptValue@@@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_objlen referenced in function "public: void __thiscall DsCScriptTableValue::AddValue(class DsCScriptValue &)" (?AddValue@DsCScriptTableValue@@QAEXAAVDsCScriptValue@@@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_settable referenced in function "public: void __thiscall DsCScriptTableValue::SetValue(class DsCScriptValue &,class DsCScriptValue &)" (?SetValue@DsCScriptTableValue@@QAEXAAVDsCScriptValue@@0@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_pushnumber referenced in function "public: __thiscall DsCScriptValue::DsCScriptValue(class DsCScriptEngine const &,double)" (??0DsCScriptValue@@QAE@ABVDsCScriptEngine@@N@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__luaL_unref referenced in function "public: __thiscall DsCScriptValue::~DsCScriptValue(void)" (??1DsCScriptValue@@QAE@XZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_tolstring referenced in function "public: char const * __thiscall DsCScriptValue::GetStr(void)const " (?GetStr@DsCScriptValue@@QBEPBDXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_isstring referenced in function "public: char const * __thiscall DsCScriptValue::GetStr(void)const " (?GetStr@DsCScriptValue@@QBEPBDXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_tonumber referenced in function "public: double __thiscall DsCScriptValue::GetInt(void)const " (?GetInt@DsCScriptValue@@QBENXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_isnumber referenced in function "public: double __thiscall DsCScriptValue::GetInt(void)const " (?GetInt@DsCScriptValue@@QBENXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_tocfunction referenced in function "public: int (__cdecl*__thiscall DsCScriptValue::GetCFunc(void)const )(struct lua_State *)" (?GetCFunc@DsCScriptValue@@QBEP6AHPAUlua_State@@@ZXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_iscfunction referenced in function "public: int (__cdecl*__thiscall DsCScriptValue::GetCFunc(void)const )(struct lua_State *)" (?GetCFunc@DsCScriptValue@@QBEP6AHPAUlua_State@@@ZXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_gettable referenced in function "public: class DsCScriptValue __thiscall DsCScriptValue::GetTableValue(char const *)" (?GetTableValue@DsCScriptValue@@QAE?AV1@PBD@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_setfield referenced in function "public: long __thiscall DsCScriptEngine::RegisterCFunction(class IDsScriptFunction *)" (?RegisterCFunction@DsCScriptEngine@@QAEJPAVIDsScriptFunction@@@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_pushcclosure referenced in function "public: long __thiscall DsCScriptEngine::RegisterCFunction(class IDsScriptFunction *)" (?RegisterCFunction@DsCScriptEngine@@QAEJPAVIDsScriptFunction@@@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_pushlightuserdata referenced in function "public: long __thiscall DsCScriptEngine::RegisterCFunction(class IDsScriptFunction *)" (?RegisterCFunction@DsCScriptEngine@@QAEJPAVIDsScriptFunction@@@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_pushnil referenced in function "protected: void __thiscall IDsScriptFunction::AddReturnValue(void)" (?AddReturnValue@IDsScriptFunction@@IAEXXZ)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_toboolean referenced in function "int __cdecl luaCFunc(struct lua_State *)" (?luaCFunc@@YAHPAUlua_State@@@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_gettop referenced in function "int __cdecl luaCFunc(struct lua_State *)" (?luaCFunc@@YAHPAUlua_State@@@Z)
1>dscscript.obj : error LNK2019: unresolved external symbol __imp__lua_touserdata referenced in function "int __cdecl luaCFunc(struct lua_State *)" (?luaCFunc@@YAHPAUlua_State@@@Z)



Thanks,


--
---------------------------------------------
Jorg B Jorge (@realjbj)
jbj@ip.tv
http://www.ip.tv
http://jbjorge.blogspot.com
http://br.linkedin.com/in/jbjorge
---------------------------------------------