problem with linking :?

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
adrian_007
Posts: 32
Joined: 2006-03-06 10:54
Location: Poland

problem with linking :?

Post by adrian_007 » 2006-06-25 19:37

i try to add lua scripts to my client (0.689 => 0.691) and i have those errors:

Code: Select all

Linking...
client.lib(Client.obj) : error LNK2019: unresolved external symbol @lua_pushlightuserdata@8 referenced in function "protected: void __thiscall ScriptInstance::LuaPush<class>(class Client *)" (??$LuaPush@VClient@@@ScriptInstance@@IAEXPAVClient@@@Z)
client.lib(ScriptManager.obj) : error LNK2001: unresolved external symbol @lua_pushlightuserdata@8
client.lib(UserConnection.obj) : error LNK2001: unresolved external symbol @lua_pushlightuserdata@8
client.lib(NmdcHub.obj) : error LNK2001: unresolved external symbol @lua_pushlightuserdata@8
client.lib(Client.obj) : error LNK2019: unresolved external symbol @lua_settop@8 referenced in function "public: class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > __thiscall ClientScriptInstance::formatChatMessage(class Client *,class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> >)" (?formatChatMessage@ClientScriptInstance@@QAE?AV?$basic_string@DV?$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@PAVClient@@V23@@Z)
client.lib(ScriptManager.obj) : error LNK2001: unresolved external symbol @lua_settop@8
client.lib(Client.obj) : error LNK2019: unresolved external symbol @lua_tostring@8 referenced in function "public: class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > __thiscall ClientScriptInstance::formatChatMessage(class Client *,class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> >)" (?formatChatMessage@ClientScriptInstance@@QAE?AV?$basic_string@DV?$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@PAVClient@@V23@@Z)
client.lib(ScriptManager.obj) : error LNK2001: unresolved external symbol @lua_tostring@8
client.lib(Client.obj) : error LNK2019: unresolved external symbol @lua_isstring@8 referenced in function "public: class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > __thiscall ClientScriptInstance::formatChatMessage(class Client *,class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> >)" (?formatChatMessage@ClientScriptInstance@@QAE?AV?$basic_string@DV?$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@PAVClient@@V23@@Z)
client.lib(ScriptManager.obj) : error LNK2001: unresolved external symbol @lua_isstring@8
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_tonumber@8 referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" (?PostMessageW@LuaManager@@QAEHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_touserdata@8 referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" (?PostMessageW@LuaManager@@QAEHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_isnumber@8 referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" (?PostMessageW@LuaManager@@QAEHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_type@8 referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" (?PostMessageW@LuaManager@@QAEHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_gettop@4 referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" (?PostMessageW@LuaManager@@QAEHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_pushnumber@12 referenced in function "protected: void __thiscall ScriptInstance::LuaPush(int)" (?LuaPush@ScriptInstance@@IAEXH@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_gettable@8 referenced in function "private: static int __fastcall Lunar<struct>::gc_T(struct lua_State *)" (?gc_T@?$Lunar@ULuaManager@@@@CIHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_pushvalue@8 referenced in function "private: static int __fastcall Lunar<struct>::gc_T(struct lua_State *)" (?gc_T@?$Lunar@ULuaManager@@@@CIHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaL_getmetafield@12 referenced in function "private: static int __fastcall Lunar<struct>::gc_T(struct lua_State *)" (?gc_T@?$Lunar@ULuaManager@@@@CIHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol _lua_pushfstring referenced in function "private: static int __fastcall Lunar<struct>::tostring_T(struct lua_State *)" (?tostring_T@?$Lunar@ULuaManager@@@@CIHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_settable@8 referenced in function "private: static void __fastcall Lunar<struct>::set(struct lua_State *,int,char const *)" (?set@?$Lunar@ULuaManager@@@@CIXPAUlua_State@@HPBD@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_insert@8 referenced in function "private: static void __fastcall Lunar<struct>::set(struct lua_State *,int,char const *)" (?set@?$Lunar@ULuaManager@@@@CIXPAUlua_State@@HPBD@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_pushstring@8 referenced in function "private: static void __fastcall Lunar<struct>::set(struct lua_State *,int,char const *)" (?set@?$Lunar@ULuaManager@@@@CIXPAUlua_State@@HPBD@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaL_typerror@12 referenced in function "public: static struct LuaManager * __fastcall Lunar<struct>::check(struct lua_State *,int)" (?check@?$Lunar@ULuaManager@@@@SIPAULuaManager@@PAUlua_State@@H@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaL_checkudata@12 referenced in function "public: static struct LuaManager * __fastcall Lunar<struct>::check(struct lua_State *,int)" (?check@?$Lunar@ULuaManager@@@@SIPAULuaManager@@PAUlua_State@@H@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_newuserdata@8 referenced in function "private: static void * __fastcall Lunar<struct>::pushuserdata(struct lua_State *,void *,unsigned int)" (?pushuserdata@?$Lunar@ULuaManager@@@@CIPAXPAUlua_State@@PAXI@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_checkstack@8 referenced in function "private: static void * __fastcall Lunar<struct>::pushuserdata(struct lua_State *,void *,unsigned int)" (?pushuserdata@?$Lunar@ULuaManager@@@@CIPAXPAUlua_State@@PAXI@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_pushlstring@12 referenced in function "private: static void __fastcall Lunar<struct>::weaktable(struct lua_State *,char const *)" (?weaktable@?$Lunar@ULuaManager@@@@CIXPAUlua_State@@PBD@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_setmetatable@8 referenced in function "private: static void __fastcall Lunar<struct>::weaktable(struct lua_State *,char const *)" (?weaktable@?$Lunar@ULuaManager@@@@CIXPAUlua_State@@PBD@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_newtable@4 referenced in function "private: static void __fastcall Lunar<struct>::weaktable(struct lua_State *,char const *)" (?weaktable@?$Lunar@ULuaManager@@@@CIXPAUlua_State@@PBD@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_error@4 referenced in function "public: int __thiscall LuaManager::GetSetting(struct lua_State *)" (?GetSetting@LuaManager@@QAEHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_remove@8 referenced in function "private: static int __fastcall Lunar<struct>::thunk(struct lua_State *)" (?thunk@?$Lunar@ULuaManager@@@@CIHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_replace@8 referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" (?push@?$Lunar@ULuaManager@@@@SIHPAUlua_State@@PAULuaManager@@_N@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_pushboolean@8 referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" (?push@?$Lunar@ULuaManager@@@@SIHPAUlua_State@@PAULuaManager@@_N@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol _luaL_error referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" (?push@?$Lunar@ULuaManager@@@@SIHPAUlua_State@@PAULuaManager@@_N@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaL_getmetatable@8 referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" (?push@?$Lunar@ULuaManager@@@@SIHPAUlua_State@@PAULuaManager@@_N@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_pushnil@4 referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" (?push@?$Lunar@ULuaManager@@@@SIHPAUlua_State@@PAULuaManager@@_N@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_pushcclosure@12 referenced in function "public: static void __fastcall Lunar<struct>::Register(struct lua_State *)" (?Register@?$Lunar@ULuaManager@@@@SIXPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaL_newmetatable@8 referenced in function "public: static void __fastcall Lunar<struct>::Register(struct lua_State *)" (?Register@?$Lunar@ULuaManager@@@@SIXPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_close@4 referenced in function "private: virtual __thiscall ScriptManager::~ScriptManager(void)" (??1ScriptManager@@EAE@XZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_strlen@8 referenced in function "public: int __thiscall LuaManager::SendUDPPacket(struct lua_State *)" (?SendUDPPacket@LuaManager@@QAEHPAUlua_State@@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_pcall@16 referenced in function "private: bool __thiscall ScriptInstance::MakeCallRaw(class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > const &,int,int)" (?MakeCallRaw@ScriptInstance@@AAE_NABV?$basic_string@DV?$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@0HH@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_call@12 referenced in function "void __fastcall callalert(struct lua_State *,int)" (?callalert@@YIXPAUlua_State@@H@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaL_loadfile@8 referenced in function "int __fastcall lua_dofile(struct lua_State *,char const *)" (?lua_dofile@@YIHPAUlua_State@@PBD@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaL_loadbuffer@16 referenced in function "int __fastcall lua_dobuffer(struct lua_State *,char const *,unsigned int,char const *)" (?lua_dobuffer@@YIHPAUlua_State@@PBDI1@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaopen_loadlib@4 referenced in function "public: void __thiscall ScriptManager::load(void)" (?load@ScriptManager@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaopen_debug@4 referenced in function "public: void __thiscall ScriptManager::load(void)" (?load@ScriptManager@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaopen_table@4 referenced in function "public: void __thiscall ScriptManager::load(void)" (?load@ScriptManager@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaopen_math@4 referenced in function "public: void __thiscall ScriptManager::load(void)" (?load@ScriptManager@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaopen_string@4 referenced in function "public: void __thiscall ScriptManager::load(void)" (?load@ScriptManager@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaopen_io@4 referenced in function "public: void __thiscall ScriptManager::load(void)" (?load@ScriptManager@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @luaopen_base@4 referenced in function "public: void __thiscall ScriptManager::load(void)" (?load@ScriptManager@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @lua_open@0 referenced in function "public: void __thiscall ScriptManager::load(void)" (?load@ScriptManager@@QAEXXZ)
L:\SRC\DCPlusPlus-0.689-src MOD\App/DCPlusPlus.exe : fatal error LNK1120: 47 unresolved externals
can someone help me? :)
thanks.

TheParanoidOne
Forum Moderator
Posts: 1420
Joined: 2003-04-22 14:37

Post by TheParanoidOne » 2006-06-26 00:15

Has the file containing the new code been added to the project?
The world is coming to an end. Please log off.

DC++ Guide | Words

adrian_007
Posts: 32
Joined: 2006-03-06 10:54
Location: Poland

Post by adrian_007 » 2006-06-26 04:21

hmm.. i add lua-5.0.2.vcproj to solution, but i think that i don't do everything (source seems to be good)

poy
Posts: 83
Joined: 2006-04-03 15:55

Post by poy » 2006-06-26 09:54

in the properties of your project, in "Additional IncludeDirectories", have you added the lua/include directory?

adrian_007
Posts: 32
Joined: 2006-03-06 10:54
Location: Poland

Post by adrian_007 » 2006-06-26 13:45

yes, i add /include folder

Code: Select all

"$(SolutionDir)stlport";"$(SolutionDir)wtl";"$(SolutionDir)yassl\include";"./lua-5.0.2/include"

Pothead
Posts: 223
Joined: 2005-01-15 06:55

Post by Pothead » 2006-06-26 18:53

Try changing the Calling convention in the project properties. :)

adrian_007
Posts: 32
Joined: 2006-03-06 10:54
Location: Poland

Post by adrian_007 » 2006-06-26 20:01

for what i have to change this? ;)
thanks.
//edit
no changes, still i have thesame errors :(

poy
Posts: 83
Joined: 2006-04-03 15:55

Post by poy » 2006-06-26 21:14

check you also add the lua/include directory to the "client" project, since all the errors seem to be in client.lib.

adrian_007
Posts: 32
Joined: 2006-03-06 10:54
Location: Poland

Post by adrian_007 » 2006-06-27 05:28

i already add /include folder to client.vcproj :)

poy
Posts: 83
Joined: 2006-04-03 15:55

Post by poy » 2006-06-27 18:01

have you tried to compile a DC++ mod that already includes LUA scripts? if it works, you could then compare the way LUA is included in this mod with your own way.
Last edited by poy on 2006-06-28 13:54, edited 1 time in total.

adrian_007
Posts: 32
Joined: 2006-03-06 10:54
Location: Poland

Post by adrian_007 » 2006-06-28 08:40

yyy :/ i try compare my client to bcdc++ and dcdm++ and i don't find any diffs.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2006-07-03 17:57

Did you set the project dependencies correctly, so the lua lib gets compiled and linked with client.lib? (Make sure to do this for both Release and Debug configurations.)

There are a lot of places things go wrong, so if you have more problems, try using WinDiff to compare the two source trees.

adrian_007
Posts: 32
Joined: 2006-03-06 10:54
Location: Poland

Post by adrian_007 » 2006-07-03 18:11

hehe... i have no idea how-to add this, so i get source from zion++ and now i just have to copy lua.dll to dc directory :D but if u can, write clearly, how-to "set correctly project dependencies" ? i know, that project don't see lua /include files, but this is other problem, and i have another :)
i want to color all app like bcdc do it [by lua script] and i do somethings changes in code... and naturaly i have errors, that i don't understand :P

Code: Select all

l:\Src\DCPlusPlus-0.689-src MOD\windows\HubFrame.cpp(60): error C2039: 'SetBackgroundColor' : is not a member of 'WTL::CEditT<TBase>'
        with
        [
            TBase=ATL::CWindow
        ]
i try wtl 8.0, 7.5 and modded from zion, nothing happends
and i try to add this part of code [bcdc++]

Code: Select all

//adrian edit
	ctrlClient.SetFont(WinUtil::font);
	ctrlClient.SetBackgroundColor(WinUtil::bgColor);
	CHARFORMAT textFormat;
	textFormat.dwMask = CFM_COLOR;
	textFormat.dwEffects = 0;
	textFormat.crTextColor = WinUtil::textColor;
	ctrlClient.SetDefaultCharFormat(textFormat);
//end
any ideas?
btw, maybe someone knows way to color chat and orther things by lua? [i mean someone have links to topics on other forums, or have some nice, clear advices :)]
thanks.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2006-07-03 21:53

adrian_007 wrote:if u can, write clearly, how-to "set correctly project dependencies" ?
Right click on the base item in the "Solution Explorer" window and select "Build Dependencies."

adrian_007
Posts: 32
Joined: 2006-03-06 10:54
Location: Poland

Post by adrian_007 » 2006-07-04 04:22

hmm, and in project dependencies [client] i should mark lua... i forgot about that... when i wil have more time, i will re-write this. thanks all for helping ;)

Locked