Compiling TFS 1.3 vcpkg windows

Itutorial

Premium User
Premium User
Joined
Dec 23, 2014
Messages
1,534
Best answers
35
Reaction score
374
1) Install Visual Studio 2017 (make sure you include c++ it doesn't come preincluded)

Open windows powershell

Code:
cd C:\
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
For 64bit compiling
Code:
.\vcpkg install boost-iostreams:x64-windows boost-asio:x64-windows boost-system:x64-windows boost-filesystem:x64-windows boost-variant:x64-windows boost-lockfree:x64-windows luajit:x64-windows libmariadb:x64-windows pugixml:x64-windows mpir:x64-windows cryptopp:x64-windows
for 32bit compiling
Code:
.\vcpkg install boost-iostreams:x86-windows boost-asio:x86-windows boost-system:x86-windows boost-filesystem:x86-windows boost-variant:x86-windows boost-lockfree:x86-windows luajit:x86-windows libmariadb:x86-windows pugixml:x86-windows mpir:x86-windows cryptopp:x86-windows
Keep in mind this step takes a long time and it may seem like the powershell freezes. Just wait it out.

Open your TFS.vcxproj

Additional Includes
Code:
C:\vcpkg
Additional libraries
Code:
C:\vcpkg
Wait for files to parse then rebuild. That should be it.


If you get an error for lua.hpp

download TFS-SDK3.2

add include to visual studio
Code:
C:\pathTo\TFS-SDK3.2\luaJIT\include
add to libraries
Code:
C:\pathTo\TFS-SDK3.2\luaJIT\lib(or lib64)
 
Last edited:

Fox Rother

Highly Skilled in Noobing
Premium User
Joined
Aug 10, 2010
Messages
59
Best answers
0
Reaction score
23
@Itutorial Thank you for promptly answering!
I might be mistaken, but I think I have it installed already
1570588818578.png
 
OP
Itutorial

Itutorial

Premium User
Premium User
Joined
Dec 23, 2014
Messages
1,534
Best answers
35
Reaction score
374
Im afraid this one is out of my scope of knowledge. If there is no answer by tomorrow I will see what I can dig up.
 

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
5,046
Best answers
471
Reaction score
2,677
Could you show all of the errors?
 

Fox Rother

Highly Skilled in Noobing
Premium User
Joined
Aug 10, 2010
Messages
59
Best answers
0
Reaction score
23
@Delusion It's the only error showing up. There are no warnings, too. x.x

Include path:
$(VC_IncludePath);$(WindowsSDK_IncludePath);C:\Users\myuser\Desktop\forgottenserver-master\tfs-sdk-3.2\LuaJIT\include;C:\Users\myuser\vcpkg;

Libraries path:
$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;C:\Users\myuser\Desktop\forgottenserver-master\tfs-sdk-3.2\LuaJIT\lib64;C:\Users\myuser\vcpkg;

Edit: Actually, there was a warning, as seen in the screenshot, but it's gone (?).
1570590198821.png
 

Attachments

Last edited:

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
5,046
Best answers
471
Reaction score
2,677
Are you compiling x64 Release? Also make sure you're using VS2017, not VS2019, there could be incompatibilities with the compiler or it's defaulting to a newer C++ language standard.
Also don't do what he says and don't manually add the SDK, there's a reason it was removed. If you get errors with compiling with lua.hpp, change #include <lua.hpp> to #include <luajit/lua.hpp> (configmanager.cpp, luascript.h) since vcpkg installs it into its own folder.
 

Fox Rother

Highly Skilled in Noobing
Premium User
Joined
Aug 10, 2010
Messages
59
Best answers
0
Reaction score
23
Are you compiling x64 Release? Also make sure you're using VS2017, not VS2019, there could be incompatibilities with the compiler or it's defaulting to a newer C++ language standard.
@Delusion Yes, x64. I was using 2017, but I could only download MSVC v142 for 2019.

I'll try again, brb. :)

Edit: Please ignore the comment on the MSVC version. That was a mess of my own. :p
 
Last edited:

Fox Rother

Highly Skilled in Noobing
Premium User
Joined
Aug 10, 2010
Messages
59
Best answers
0
Reaction score
23
Update

@Delusion
  • Used VS Community 2017
  • Installed the exact Windows SDK version needed as per the VS project file (10.0.17134.0)
  • Downloaded and compiled every package as specified on the repo wiki with vcpkg
  • Updated Include and Libraries directories with vcpkg folder
  • Changed the lua includes in both configmanager.cpp, luascript.h
Good news: The errors are gone!
Bad news: A lot of new errors showed up! Hehe.

1>------ Build started: Project: theforgottenserver, Configuration: Release x64 ------
1>otpch.cpp
1>actions.cpp
1>ban.cpp
1>baseevents.cpp
1>bed.cpp
1>chat.cpp
1>combat.cpp
1>condition.cpp
1>configmanager.cpp
1>connection.cpp
1>container.cpp
1>creature.cpp
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\detail\forced_return.hpp(40): warning C4459: declaration of 'dummy' hides global declaration (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\desktop\forgottenserver-master\src\configmanager.cpp(190): note: see declaration of 'dummy'
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\detail\visitation_impl.hpp(162): note: see reference to function template instantiation 'T boost::detail::variant::forced_return<result_type>(void)' being compiled
1> with
1> [
1> T=result_type
1> ] (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\detail\visitation_impl.hpp(231): note: see reference to function template instantiation 'void boost::detail::variant::visitation_impl_invoke<Visitor,VoidPtrCV,NoBackupFlag>(int,Visitor &,VoidPtrCV,boost::detail::variant::apply_visitor_unrolled *,NBF,long)' being compiled
1> with
1> [
1> Visitor=boost::detail::variant::destroyer,
1> VoidPtrCV=void *,
1> NoBackupFlag=boost::variant<boost::blank,std::string,int64_t,double,bool>::has_fallback_type_,
1> NBF=boost::variant<boost::blank,std::string,int64_t,double,bool>::has_fallback_type_
1> ] (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\variant.hpp(2339): note: see reference to function template instantiation 'void boost::detail::variant::visitation_impl<first_which,first_step,Visitor,VoidPtrCV,boost::variant<boost::blank,std::string,int64_t,double,bool>::has_fallback_type_>(const int,const int,Visitor &,VoidPtrCV,boost::mpl::false_,NoBackupFlag,Which *,step0 *)' being compiled
1> with
1> [
1> Visitor=boost::detail::variant::destroyer,
1> VoidPtrCV=void *,
1> NoBackupFlag=boost::variant<boost::blank,std::string,int64_t,double,bool>::has_fallback_type_,
1> Which=first_which,
1> step0=first_step
1> ] (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\variant.hpp(2348): note: see reference to function template instantiation 'void boost::variant<boost::blank,std::string,int64_t,double,bool>::internal_apply_visitor_impl<Visitor,void*>(int,int,Visitor &,VoidPtrCV)' being compiled
1> with
1> [
1> Visitor=boost::detail::variant::destroyer,
1> VoidPtrCV=void *
1> ] (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\variant.hpp(2346): note: see reference to function template instantiation 'void boost::variant<boost::blank,std::string,int64_t,double,bool>::internal_apply_visitor_impl<Visitor,void*>(int,int,Visitor &,VoidPtrCV)' being compiled
1> with
1> [
1> Visitor=boost::detail::variant::destroyer,
1> VoidPtrCV=void *
1> ] (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\variant.hpp(1365): note: see reference to function template instantiation 'void boost::variant<boost::blank,std::string,int64_t,double,bool>::internal_apply_visitor<boost::detail::variant::destroyer>(Visitor &)' being compiled
1> with
1> [
1> Visitor=boost::detail::variant::destroyer
1> ] (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\variant.hpp(1365): note: see reference to function template instantiation 'void boost::variant<boost::blank,std::string,int64_t,double,bool>::internal_apply_visitor<boost::detail::variant::destroyer>(Visitor &)' being compiled
1> with
1> [
1> Visitor=boost::detail::variant::destroyer
1> ] (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\variant.hpp(1363): note: while compiling class template member function 'void boost::variant<boost::blank,std::string,int64_t,double,bool>::destroy_content(void) noexcept' (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\vcpkg\installed\x64-windows\include\boost\variant\variant.hpp(1372): note: see reference to function template instantiation 'void boost::variant<boost::blank,std::string,int64_t,double,bool>::destroy_content(void) noexcept' being compiled (compiling source file ..\src\configmanager.cpp)
1>c:\users\foxro\desktop\forgottenserver-master\src\item.h(218): note: see reference to class template instantiation 'boost::variant<boost::blank,std::string,int64_t,double,bool>' being compiled (compiling source file ..\src\configmanager.cpp)
1>creatureevent.cpp
1>cylinder.cpp
1>database.cpp
1>databasemanager.cpp
1>databasetasks.cpp
1>depotchest.cpp
1>depotlocker.cpp
1>events.cpp
1>fileloader.cpp
1>game.cpp
1>globalevent.cpp
1>groups.cpp
1>guild.cpp
1>house.cpp
1>housetile.cpp
1>inbox.cpp
1>ioguild.cpp
1>iologindata.cpp
1>iomap.cpp
1>iomapserialize.cpp
1>iomarket.cpp
1>item.cpp
1>items.cpp
1>luascript.cpp
1>mailbox.cpp
1>map.cpp
1>monster.cpp
1>monsters.cpp
1>mounts.cpp
1>movement.cpp
1>networkmessage.cpp
1>npc.cpp
1>otserv.cpp
1>outfit.cpp
1>outputmessage.cpp
1>party.cpp
1>player.cpp
1>position.cpp
1>protocol.cpp
1>protocolgame.cpp
1>protocollogin.cpp
1>protocolold.cpp
1>quests.cpp
1>raids.cpp
1>rsa.cpp
1>scheduler.cpp
1>script.cpp
1>scriptmanager.cpp
1>server.cpp
1>signals.cpp
1>spawn.cpp
1>spells.cpp
1>protocolstatus.cpp
1>talkaction.cpp
1>tasks.cpp
1>teleport.cpp
1>thing.cpp
1>tile.cpp
1>tools.cpp
1>trashholder.cpp
1>vocation.cpp
1>waitlist.cpp
1>weapons.cpp
1>wildcardtree.cpp
1>xtea.cpp
1>cryptopp-static.lib(ec2n.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(ecp.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(hex.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(rng.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(modes.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(gfpcrypt.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(hmac.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(gf2n.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(oaep.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(mqueue.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(rijndael.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(hrtimer.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(dll.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(nbtheory.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(pubkey.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(iterhash.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(base64.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(randpool.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(osrng.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(algparam.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(misc.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(cryptlib.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(filters.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(basecode.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(integer.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(queue.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(asn.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(rsa.cpp.obj) : error LNK2001: unresolved external symbol __CxxFrameHandler4
1>cryptopp-static.lib(ecp.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(hex.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(rng.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(gfpcrypt.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(hmac.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(gf2n.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(ec2n.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(mqueue.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(rijndael.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(hrtimer.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(modes.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(dll.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(nbtheory.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(pubkey.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(iterhash.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(base64.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(randpool.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(osrng.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(algparam.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(misc.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(cryptlib.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(filters.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(basecode.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(integer.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(queue.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(asn.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>cryptopp-static.lib(rsa.cpp.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4
1>C:\Users\foxro\Desktop\forgottenserver-master\vc14\x64\Release\theforgottenserver-x64.exe : fatal error LNK1120: 2 unresolved externals
1>Done building project "theforgottenserver.vcxproj" -- FAILED.
 

Fox Rother

Highly Skilled in Noobing
Premium User
Joined
Aug 10, 2010
Messages
59
Best answers
0
Reaction score
23
Is anyone able to compile from Windows 10? Please send me a message.
 

Piquenoelmal

I'm in an eternal depression
Joined
Dec 1, 2009
Messages
31
Best answers
0
Reaction score
7
Location
São Paulo
Is anyone able to compile from Windows 10? Please send me a message.
Yeah, I did. I used the SKD v10.0.18362.0 and the toolset v141.
After that, I had to include some files from the tfs-sdk manually and installed the vcpkg using the git bash tool.

Server up and running.

Edit: If you need help with windows, just PM me.
 
Last edited:

Fox Rother

Highly Skilled in Noobing
Premium User
Joined
Aug 10, 2010
Messages
59
Best answers
0
Reaction score
23
Yeah, I did. I used the SKD v10.0.18362.0 and the toolset v141.
After that, I had to include some files from the tfs-sdk manually and installed the vcpkg using the git bash tool.

Server up and running.
@Piquenoelmal Gratz! I'm still puzzled by how mysterious this process is hehehe. :p
Some people say the versions are unimportant, others that we shouldn't use the TFS SDK... And I can't even object, because each of these different approaches work.
I was able to compile and debug it using WSL, but the IDE keeps linting includes...
It does so because it's unable to access the WSL filesystem directly.
That shouldn't be a problem though. VS automatically zips all the headers on the remote and download them to local...
The only solution for the inaccurate linting is using vcpkg to also install the packages locally.
I've been trying to sort this out for days. Getting cuckoo already 🤪
 

Klonera

Once upon a time.
Premium User
Joined
Jul 16, 2016
Messages
450
Best answers
1
Reaction score
64
Location
Sweden
Is anyone able to compile from Windows 10? Please send me a message.
I can make a video tutorial if you would like, I'll post it up on Otland as a new post.
Just want to make sure ppl needs it and I'll lend a hand.
 

Piquenoelmal

I'm in an eternal depression
Joined
Dec 1, 2009
Messages
31
Best answers
0
Reaction score
7
Location
São Paulo
Yeah, I really don't like to use VS. I tried with the CLion IDE, but it didn't work at all.

I'm pretty sure that the SDK, Version and VCPKG(x32 or x64) matters.

Also, the problem that you post here, the alloc problem, was fixed in my case setting SKD v10.0.18362.0 and the toolset v141. The problems with the include or lib were solved after I manually set the include/lib on the project.

To do that, you can:
  • Open your .vcxproj
  • Now, you will have to get the tfs-sdk files. Extract them somewhere
  • When your VS is open, right click "TheForgottenTibiaServer", it will open a menu. Go to Properties. (You can alt+enter as well)
  • After that, go to VC++ Directories, it will open a menu with some fields. Find the "Include directories" and "Library directories"
  • In the "Include directories", double clicked it, click in the dropdown and click edit.
  • Now, go to the tfs-sdk\LuaJIT\include. Use this folder.
  • Now, in the "Library directories", do the same as in the include and use the LuaJIT folder (tfs-sdk\LuaJIT)
  • Apply your changes and click ok
That was how I set everything and everything is ok now.
 

Fox Rother

Highly Skilled in Noobing
Premium User
Joined
Aug 10, 2010
Messages
59
Best answers
0
Reaction score
23
Thank you, guys! 😊

@Piquenoelmal
I'll try that approach one more time and see how it goes. Last time I did something similar, the compiler started to throw errors related to the cryptopp lib (which was just fine [???]). I even used the exact W10 SDK and MSVC versions the project file originally asks for. D:
Maybe with a different SDK it works. That's valuable information, actually! The exact versions are the secret sauce, apparently.
Someone should change these files and push it to master :p

@Klonera
I think there should be more content being produced around TFS source. So please, make the video! We need to lower the barrier a bit... The environment setup is just a little bit too much :b
 

Piquenoelmal

I'm in an eternal depression
Joined
Dec 1, 2009
Messages
31
Best answers
0
Reaction score
7
Location
São Paulo
Thank you, guys! 😊

@Piquenoelmal
I'll try that approach one more time and see how it goes. Last time I did something similar, the compiler started to throw errors related to the cryptopp lib (which was just fine [???]). I even used the exact W10 SDK and MSVC versions the project file originally asks for. D:
Maybe with a different SDK it works. That's valuable information, actually! The exact versions are the secret sauce, apparently.
Someone should change these files and push it to master :p

@Klonera
I think there should be more content being produced around TFS source. So please, make the video! We need to lower the barrier a bit... The environment setup is just a little bit too much :b
Cryptopp lib, and another lib's missing problem, happens when you try to compile with the wrong version of vcpkg. Always remember to set to release and x32 or x64.
Still, if you can't compile even with the right options, try to set the lib manually as I described with the LuaJIT.
 
Top