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 @[email protected] referenced in function "protected: void __thiscall ScriptInstance::LuaPush<class>(class Client *)" ([email protected]@@@[email protected]@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2001: unresolved external symbol @[email protected]
client.lib(UserConnection.obj) : error LNK2001: unresolved external symbol @[email protected]
client.lib(NmdcHub.obj) : error LNK2001: unresolved external symbol @[email protected]
client.lib(Client.obj) : error LNK2019: unresolved external symbol @[email protected] 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> >)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z)
client.lib(ScriptManager.obj) : error LNK2001: unresolved external symbol @[email protected]
client.lib(Client.obj) : error LNK2019: unresolved external symbol @[email protected] 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> >)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z)
client.lib(ScriptManager.obj) : error LNK2001: unresolved external symbol @[email protected]
client.lib(Client.obj) : error LNK2019: unresolved external symbol @lua_isstr[email protected] 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> >)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z)
client.lib(ScriptManager.obj) : error LNK2001: unresolved external symbol @[email protected]
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" ([email protected]@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" ([email protected]@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" ([email protected]@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" ([email protected]@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: int __thiscall LuaManager::PostMessageW(struct lua_State *)" ([email protected]@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "protected: void __thiscall ScriptInstance::LuaPush(int)" ([email protected]@@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static int __fastcall Lunar<struct>::gc_T(struct lua_State *)" ([email protected][email protected]@@@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static int __fastcall Lunar<struct>::gc_T(struct lua_State *)" ([email protected][email protected]@@@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static int __fastcall Lunar<struct>::gc_T(struct lua_State *)" ([email protected][email protected]@@@@[email protected]@@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 *)" ([email protected][email protected]@@@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static void __fastcall Lunar<struct>::set(struct lua_State *,int,char const *)" ([email protected][email protected]@@@@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static void __fastcall Lunar<struct>::set(struct lua_State *,int,char const *)" ([email protected][email protected]@@@@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static void __fastcall Lunar<struct>::set(struct lua_State *,int,char const *)" ([email protected][email protected]@@@@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: static struct LuaManager * __fastcall Lunar<struct>::check(struct lua_State *,int)" ([email protected][email protected]@@@@[email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: static struct LuaManager * __fastcall Lunar<struct>::check(struct lua_State *,int)" ([email protected][email protected]@@@@[email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static void * __fastcall Lunar<struct>::pushuserdata(struct lua_State *,void *,unsigned int)" ([email protected][email protected]@@@@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static void * __fastcall Lunar<struct>::pushuserdata(struct lua_State *,void *,unsigned int)" ([email protected][email protected]@@@@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static void __fastcall Lunar<struct>::weaktable(struct lua_State *,char const *)" ([email protected][email protected]@@@@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static void __fastcall Lunar<struct>::weaktable(struct lua_State *,char const *)" ([email protected][email protected]@@@@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static void __fastcall Lunar<struct>::weaktable(struct lua_State *,char const *)" ([email protected][email protected]@@@@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: int __thiscall LuaManager::GetSetting(struct lua_State *)" ([email protected]@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: static int __fastcall Lunar<struct>::thunk(struct lua_State *)" ([email protected][email protected]@@@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" ([email protected][email protected]@@@@[email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" ([email protected][email protected]@@@@[email protected]@[email protected]@[email protected])
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)" ([email protected][email protected]@@@@[email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" ([email protected][email protected]@@@@[email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: static int __fastcall Lunar<struct>::push(struct lua_State *,struct LuaManager *,bool)" ([email protected][email protected]@@@@[email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: static void __fastcall Lunar<struct>::Register(struct lua_State *)" ([email protected][email protected]@@@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: static void __fastcall Lunar<struct>::Register(struct lua_State *)" ([email protected][email protected]@@@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "private: virtual __thiscall ScriptManager::~ScriptManager(void)" ([email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: int __thiscall LuaManager::SendUDPPacket(struct lua_State *)" ([email protected]@@[email protected]@@Z)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] 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)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "void __fastcall callalert(struct lua_State *,int)" ([email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "int __fastcall lua_dofile(struct lua_State *,char const *)" ([email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "int __fastcall lua_dobuffer(struct lua_State *,char const *,unsigned int,char const *)" ([email protected]@[email protected]@[email protected])
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: void __thiscall ScriptManager::load(void)" ([email protected]@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: void __thiscall ScriptManager::load(void)" ([email protected]@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: void __thiscall ScriptManager::load(void)" ([email protected]@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: void __thiscall ScriptManager::load(void)" ([email protected]@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: void __thiscall ScriptManager::load(void)" ([email protected]@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: void __thiscall ScriptManager::load(void)" ([email protected]@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: void __thiscall ScriptManager::load(void)" ([email protected]@@QAEXXZ)
client.lib(ScriptManager.obj) : error LNK2019: unresolved external symbol @[email protected] referenced in function "public: void __thiscall ScriptManager::load(void)" ([email protected]@@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