Compiling TFS 1.0/1.1 latest source. 64 and 32 bits. Pics and lots of explanation.

dominique120

Science & Reason
Premium User
Joined
Jun 16, 2013
Messages
3,891
Best answers
2
Likes
988
Location
Númenor
#1
Welcome to my TFS 1.0/1.1 compiling tutorial. I'm making this one because the other one is a bit messy and people where having errors and the on on Github is a bit advanced. Well enough with the stories lets get to work!

1. First lets get our includes, libs and our compiler.
2. Now that we have everything lets get started setting up our files.

2.1 Install Boost in an easy to remember place:


2.2 Same with the SDK


2.3 And lets drop that source in the OT folder I'm sure we all have, or just put it in D:

3. Now lets open up our solution.


4. Time to set up our config. Open up the properties dialog box by right clicking on the project


5. Set up the configuration. This tutorial is for x64 only, an x32 tut is coming soon, but seriously, who still uses x32?


6. Now lets set up our includes.
6.1:


6.2: Make sure your directories are appropriate, if you extracted the files somewhere else make sure you point to those directories instead of these ones.


7. Time for the libs, similar to the includes:
7.1:


7.2: Same as the includes, make sure you get the right dirs.


7.3: Hit apply to save your changes.

8. Now let it parse all the files




9. After Parsing is done it will be


10. Hit that rebuild button and let it compile away!


Once it is finished you should get something like this:


And the log should look like this
And there you have it! You just compiled The Forgotten Server 1.0 x64 developed by @Mark Samman.

Enjoy!
 
Last edited:

dominique120

Science & Reason
Premium User
Joined
Jun 16, 2013
Messages
3,891
Best answers
2
Likes
988
Location
Númenor
#2
Since a few people are still using a 32 bit version of Windows, here is a tutorial for compiling on x32:

The steps are similar to the tutorial for x64 so just replace the steps above with this ones and it should work.

1. Getting the right files. Same as above but this time we use 32 bit boost files.

2. Install Boost 32 bit to an easy to remember location.


5. Like mentioned above, extract the SDK and the source. Now open up the solution, go to properties and configuration manager. And change it like this:


6. Same as before make sure the dirs are appropriate.

7. Make sure you select the lib folders, not the lib64 folders.


Now rebuild and watch it rebuild.

Enjoy!
 
Last edited:

dominique120

Science & Reason
Premium User
Joined
Jun 16, 2013
Messages
3,891
Best answers
2
Likes
988
Location
Númenor
#3
FAQ:

Q: How do I use the batch files that come with the TFS SDK?
A: Put the "register_boost_env.bat" in the boost directory and execute it, and leave the "register_tfssdk_env.bat" where it was and execute it. Then you can skip the steps where we add directories.

Q: Why link manually?
A: I believe it is better because it removes one more thing that could go wrong. Also, if you dont have admin rights the execution of those files will fail.

Q: I get "Unable to start application 0xc0000007b"
A: You are not using the right arch with the DLLs that you downloaded. If you compiled a x64 TFS you must use x64 DLLs.

Q: I get "missing something/something.h" errors.
A: You probably did not let it parse completely or you did not link properly.

Q: My TFS crashes and says it cant connect to the database.
A: You probably did not configure the database properly or you are using 'localhost', switch to 127.0.0.1

Q: Did not find PDB file
A: You are probably compiling in debug mode, you can ignore this warning.

Q: Can I compile with GUI?
A: TFS 1.0 does not have support for GUI as it is useless.

Q: Can I compile with war system?
A: It compiles by default

Q: And cast?
A: A system is not implemented yet.

Q: Can I use another program?
A: No you can only use MSVC 2013

Q: Why did I make this tutorial?
A: I made it because the other one is very messy and hard to follow, and the one in github is a bit advanced.
 
Last edited:

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,930
Best answers
27
Likes
1,377
Location
Sweden
#4
Is there any reason you're linking include/libraries manually instead of setting SDK/Boost path with the .bat files that comes with TFS-SDK?
 

dominique120

Science & Reason
Premium User
Joined
Jun 16, 2013
Messages
3,891
Best answers
2
Likes
988
Location
Númenor
#6
Is there any reason you're linking include/libraries manually instead of setting SDK/Boost path with the .bat files that comes with TFS-SDK?
1. I am absolutely positive some people will get it wrong
2. I still get missing includes and libs if I dont add them manually.
I like to force dirs because it removes one more thing that can go wrong.

Good Tutorial but brother as ninja said why are you linking lib manually
also there is another tutorial xD and it's good
http://otland.net/threads/compiling-tfs-simple-tutorial-for-beginners.197474/
UpInSmoke
That one is not for TFS 1.0. And yes that is a fantastic tutorial, that is how I learned to compile TFS with MSVC.
 
Joined
Jul 21, 2008
Messages
175
Best answers
0
Likes
15
#7
i'm curious, how do i find this "parse" thingy?

Edit:
Error 1 error C1083: Cannot open include file: 'boost/tokenizer.hpp': No such file or directory c:\users\forc3\desktop\compiling\forgottenserver-master\src\otpch.h 30 1 theforgottenserver


This is what i get nontheless.. any idea? :)
 
Last edited:

dominique120

Science & Reason
Premium User
Joined
Jun 16, 2013
Messages
3,891
Best answers
2
Likes
988
Location
Númenor
#8
i'm curious, how do i find this "parse" thingy?

Edit:
Error 1 error C1083: Cannot open include file: 'boost/tokenizer.hpp': No such file or directory c:\users\forc3\desktop\compiling\forgottenserver-master\src\otpch.h 30 1 theforgottenserver


This is what i get nontheless.. any idea? :)
It parses automatically, let it run for a couple minutes(takes maybe 2 mins on my PC). That error is probably because it did not parse fully or you did not add the directories accordingly.
 
Last edited:

dominique120

Science & Reason
Premium User
Joined
Jun 16, 2013
Messages
3,891
Best answers
2
Likes
988
Location
Númenor
#13
Rly great tutorial, keep doing tutorials =)
Yeah I want to make one for OTC that is why I was asking about compiling it. I've also got a hold on Stians Dev-Cpp x64 repack but I still cant get it to compile in x64, I would very much like to make a tutorial for compiling 0.4 and 0.3.x in x64
 

conde2

Active Member
Joined
Jun 22, 2008
Messages
347
Best answers
0
Likes
37
#14
An Otclient tutorial would be great !! Ask me if you have any doubt.
 

Jonass

Here who doesn't run, it flies.
Joined
Nov 12, 2008
Messages
216
Best answers
0
Likes
3
#20
I think that's not quite true what you say. If there War System code.
Code player.cpp
Code:
        if (isInWar(player)) {
            return SKULL_GREEN;
        }

        if (!player->getGuildWarList().empty() && guild == player->getGuild())
 
Top