• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Compiling Compile error when adding changes

_M4G0_

Intermediate OT User
Joined
Feb 6, 2016
Messages
550
Solutions
17
Reaction score
108
someone can help, in trying implement it Lua Function - [TFS 1.3] Item abilities via Lua in my source, but in compilation these errors

Code:
1>  weapons.cpp
1>  wildcardtree.cpp
1>bed.obj : error LNK2001: unresolved external symbol "public: virtual enum Ability_ReadValue __cdecl Item::readAbility(enum AbilityTypes_t,class PropStream &)" (?readAbility@Item@@UEAA?AW4Ability_ReadValue@@W4AbilityTypes_t@@AEAVPropStream@@@Z)
1>bed.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl Item::serializeAbility(class PropWriteStream &)const " (?serializeAbility@Item@@UEBAXAEAVPropWriteStream@@@Z)
1>iologindata.obj : error LNK2001: unresolved external symbol "public: bool __cdecl Item::unserializeAbility(class PropStream &)" (?unserializeAbility@Item@@QEAA_NAEAVPropStream@@@Z)
1>luascript.obj : error LNK2001: unresolved external symbol "private: struct ItemAbilities::Ability const * __cdecl ItemAbilities::getExistingAbility(enum itemAbilityTypes)const " (?getExistingAbility@ItemAbilities@@AEBAPEBUAbility@1@W4itemAbilityTypes@@@Z)
1>luascript.obj : error LNK2001: unresolved external symbol "private: void __cdecl ItemAbilities::setAbilityInt(enum itemAbilityTypes,__int64)" (?setAbilityInt@ItemAbilities@@AEAAXW4itemAbilityTypes@@_J@Z)
1>luascript.obj : error LNK2001: unresolved external symbol "private: void __cdecl ItemAbilities::removeAbility(enum itemAbilityTypes)" (?removeAbility@ItemAbilities@@AEAAXW4itemAbilityTypes@@@Z)
1>player.obj : error LNK2001: unresolved external symbol "public: __int64 __cdecl Item::getAbilityValue(enum itemAbilityTypes)const " (?getAbilityValue@Item@@QEBA_JW4itemAbilityTypes@@@Z)
1>D:\ot\path_10_9\vc14\x64\Release\theforgottenserver.exe : fatal error LNK1120: 7 unresolved externals
1>Projeto de compilação pronto "theforgottenserver.vcxproj" -- FALHA.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Code:
C/C++ General

D:\ot\path_10_9;
D:\ot\tfs-sdk-3.2\lua\include;
C:\local\boost_1_66_0;
D:\ot\tfs-sdk-3.2\LuaJIT\include;
D:\ot\tfs-sdk-3.2\mpir\include;
D:\ot\tfs-sdk-3.2\pugixml\include;
D:\ot\tfs-sdk-3.2\mysql-connector-c\include;
D:\ot\tfs-sdk-3.2\lua\include;
%(AdditionalIncludeDirectories)

Linker
Code:
C:\local\boost_1_66_0\libs;
C:\local\boost_1_66_0\lib64-msvc-14.0;
D:\ot\tfs-sdk-3.2;
D:\ot\tfs-sdk-3.2\LuaJIT\lib64;
D:\ot\tfs-sdk-3.2\mpir\lib64;
D:\ot\tfs-sdk-3.2\lua\lib64;
D:\ot\tfs-sdk-3.2\mysql-connector-c\lib64;
%(AdditionalLibraryDirectories)
i can compile without the changes
 
Solution
i'll review, but i think i've inserted everything
if you had then it's unlikely you'd be getting a LNK2001 error, the exact reason that error occurs is because you do something like this:

in .h file
C++:
int someFunction();
but in the .cpp file you don't define this
C++:
int someFunction()
{
    return 1;
}
you added the definitions of those functions in each .cpp file they belong in?
it seems like all you did was only add to the .h files and not the .cpp files
 
i'll review, but i think i've inserted everything
if you had then it's unlikely you'd be getting a LNK2001 error, the exact reason that error occurs is because you do something like this:

in .h file
C++:
int someFunction();
but in the .cpp file you don't define this
C++:
int someFunction()
{
    return 1;
}
 
Solution
Back
Top