• 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!

[Compiling] How to compile TFS in MSVC under Windows 64-bit

Ub Kenobi

Member
Joined
Apr 10, 2009
Messages
144
Reaction score
8
Location
Sweden
[Tutorial]Compiling TFS under Win64


Error after error and then I searched and I searched and I searched... "how to compile TFS under win64"?. After 2 days of searching I figured out how to it!. So I decided to do a tutorial for it! Haters gonna hate!

(And I am completely new to this so It may not be the best solution but It worked for me.


Things you will need:


Preparations

____________________________________________________________________________________________________

1. Download and install Microsoft Visual C++ (MSVC)

____________________________________________________________________________________________________

2. Create a folder (Name it whatever you like ex. VC) Inside of that folder you make two more named include and library64

Should look like this:



____________________________________________________________________________________________________

3. Copy all "lib64" files(not folders) inside TFS SDK into your VC/library64 folder.
Note: Make sure you also copy bin64 files inside openssl into your library64 folder.

Inside TFS SDK:



____________________________________________________________________________________________________

4. Now copy all include files(not folders) inside TFS SDK into your VC/include folder.

Inside TFS SDK:



____________________________________________________________________________________________________

5. Download Boost Pre-Built Binaries and extract all of it into your VC/library64 folder.
Note: Make sure you download the same version of Binaries as Boost. I’d recommend version 1_53(Latest for now).

____________________________________________________________________________________________________

6. Copy the downloaded boost folder into VC folder.

Now it should look like this:


Now you’re ready to open Microsoft Visual C++/Studio

Inside Microsoft Visual C++/Studio


____________________________________________________________________________________________________

1. Open Project

File > Open > Project/Solution…


Then => ex. C:/TFS/source/vc10/tfs.vcxproj

Note: If you got .dev file and not .sln or .vcxproj file you can’t compile in MSVC.

____________________________________________________________________________________________________

2. Now, make sure you got x64(win64) and release selected.


____________________________________________________________________________________________________

3. Go to Project > Properties


a)
Go to => Configuration Properties > VC++ Directories
Here I'm not quite sure because I have mixed and trixed too much so I don't know if it's standard or not.


It may be different from computer to computer so don't change anything at start! Wait and see if you got errors when compiling and if so, try these:
Include Directories:
Code:
$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include
Library Directories:
Code:
$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64

b)
Go to => Configuration Properties > C/C++ > General

At Additional Include Directories:
Edit => Select your VC folder (the one you created earlier)


c)
Go to => Configuration Properties > Linker > General
At Additional Library Directories:
Edit => Select your library64 folder (the one you created earlier inside VC folder)



____________________________________________________________________________________________________

4. Let’s compile! Project > Rebuild…



If compile succeeded, you should find your tfs.exe in C:/.../source/vc10/x64/Release/


That's all. I hope it work as well for you as it did for me!
 
Last edited:
Edit: Continued reading and saw you mentioned it further down. ;3

Testing, will report the success of it within the hour.

Edit2: Update, gets all the way through till the end (weapons.cpp) then gives the error -

1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc110-mt-1_53.lib'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
 
Last edited:
I have boost folder in the VC folder, I have ran Bootstrap + bjam to set it up and it still does not work.
 
I used to get the "cannot open file" error when I had wrong directory setup in Configuration Properties.

C/C++ > Additional Include Directories > C:\VC;%(AdditionalIncludeDirectories)

Linker > Additional Library Directories > C:\VC\library64;%(AdditionalLibraryDirectories)
 
C/C++ > Additional Include Dir. > C:\VC;%(AdditionalIncludeDirectories)

Linker > Additional Library Directories > C:\VC\library64;%(AdditionalLibraryDirectories)

Is this not right? In the VC Folder, I have boost, include, library64.

(I edited it to the way you have it now)

If I dont link the boost folder in additional library directories, it gives me this error as soon as I click rebuild.
"fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory"

Is my boost not installed properly maybe?

When I link it like this:

C/C++ > Additional Include Dir. > C:\VC\boost;C:\VC;%(AdditionalIncludeDirectories)

It runs all the way through until the end, and I get this error.

1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc110-mt-1_53.lib'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

;\ Lulz, strange right?

Edit:
I figured out how to install boost properly and Im still getting the error! This thing hates me! Rep to who ever can get this fixed!

Edit2:
I got rid of the error by finding the file it needs and linking the folder to msvc, but now the error I get is this.

1> weapons.cpp
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>libboost_thread-vc110-mt-1_53.lib(thread.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I found this link: http://msdn.microsoft.com/en-us/library/5wy54dk2.aspx
It's telling me to change the linker properties to 86X, for the record I am on Windows 7 64bit and even if I change the target machine type to 86X it doesnt work ;\ Darn compiler. Although I now have it to the point where I just need the folders linked that you have, I copied the files it was missing into the lib folder.

Note, if I try your VC++ Directorys for inc/lib I get:
1> otpch.cpp
1>C:\VC\boost/asio/detail/socket_types.hpp(31): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory

Edit3:
Changed the linkers/c++ to the new boost DIR include/lib and it compiles now and seems to be in 64bit! Thank you so much!

/Extrodus
 
Last edited:
Faster will be that:
1. Download MSVC Visual Studio Professional 2012
2. tfs-sdk-1.0 - Open the folder and run 'registerenv'

and then rebuild. This was my way
 
Last edited:
Faster will be that:
1. Download MSVC Visual Studio Professional 2012
2. tfs-sdk-1.0 - Open the folder and run 'registerenv'

and then rebuild. This was my way

I tried that but it didn't work for me... I had to do it "my" way. But it's definitely a faster way if you get it to work.
 
To anyone who is getting stuck with the boost self extracting archive, follow these steps.

1. Put the downloaded .exe in a folder.
2. Go up a level in the folder tree, and right click the folder containing boost while holding the shift button.
3. Click "Open Command Line Here".
4. Type this, replacing PATH_TO_EXTRACT with the path to your library64 folder:

Code:
boost_1_53_0-vc64-bin.exe -o"PATH_TO_EXTRACT"

This will exact the library to the desired location. Note you may need to modify the file name depending on which version of boost you're using.

Another thing to consider is that if you want to succeed in building boost yourself, you must sacrifice many many goats.

Another note is that you should make sure you're set to release / debug and make sure that the architecture is selected BEFORE changing the linker and include file paths. If you don't, you'll kick yourself fucking hard afterwards.
 
Last edited:
does this meen that i can make my x32 tfs to x64?

If you have the source code of your server then you can compile it into either 64 or 32 bit. You cannot convert a executable file from 32 bit to 64 bit.
 
This is if you try to use the file that automatically loads the directories for you.

Also I would like to add, the problem people have with the tfs sdk file is when they have spaces in the directory example

C:\Tibia Sources\ is not acceptable my the sdk directory loader
C:\Tibia_Sources\ is
 
Last edited:
hmm I'm getting this error Error
Code:
error C1083: Cannot open precompiled header file: 'x64\Release\tfs.pch': No such file or directory

I'm trying to create a vc10 project file for an older distro and it loaded all the files and what not just fine... but I'm messing up one of the configurations wondering if someone can point me in the right direction.

- - - Updated - - -

Alright I fixed that error in order to fix if you get this issue making your own old distro into msvc go to
right click project>properties>Configuration Properties>C/C++>Precompiled Headers

at the top of that menu for Precompiled Header choose the drop down arrow and choose Not Using Precompiled Headers
 
Extrodus can you tell me how did you fix that error Please :)(1>------ Rebuild All started: Project: tfs, Configuration: Release x64 ------
1> otpch.cpp
1>C:\Open-Tibia\VC\boost/asio/detail/socket_types.hpp(31): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========)
 
Last edited:
Back
Top