How to compile and debug ddnet on Windows in Visual Studio
How to compile and debug ddnet on Windows in Visual Studio
How to compile and debug ddnet on Windows in Visual Studio
written by milk
There are already some teeworlds compiling tutorials for Windows (1, 2) but they are a bit outdated and not really friendly for newcomers with not quite good programming skills. I tried to make my own tutorial based on these but more extended and intuitive.
I hope this tutorial will help someone and save some time.
written by milk
There are already some teeworlds compiling tutorials for Windows (1, 2) but they are a bit outdated and not really friendly for newcomers with not quite good programming skills. I tried to make my own tutorial based on these but more extended and intuitive.
I hope this tutorial will help someone and save some time.
- Let's start.
You'll need Windows 7,8 or 10, 32/64 bit. Probably it should work on Windows XP SP3 too.
1. Install Visual Studio- 1.1 If you don't know which version is better to install, I recommend to use
Visual C++ 2010 Express
. You can also try one of these:
Visual Studio Express 2012
Visual Studio Express 2013
Visual Studio Express 2015 (for Desktop)
Visual Studio Community 2015
but they also install a lot of unnecessary stuff (about 7-10 GB), it's just a waste of disk space.
I will useVisual C++ 2010 Express
in this tutorial.
1.2 Download links to free english versions of Visual Studio:SpoilerShowMicrosoft Visual C++ 2010 Express
Web Installer:
http://download.microsoft.com/download/ ... vc_web.exe
OR offline installer (iso image):
https://go.microsoft.com/?linkid=9709969Microsoft Visual Studio Express 2012 for Windows Desktop
Web Installer or offline installer (iso image):
https://www.microsoft.com/en-us/downloa ... x?id=34673
Optional: Update 5 for Microsoft Visual Studio 2012
https://www.microsoft.com/en-us/downloa ... x?id=48708Microsoft Visual Studio Express 2013 for Windows Desktop with Update 5
Web Installer:
https://go.microsoft.com/fwlink/?LinkId=532495
OR offline installer (iso image):
https://go.microsoft.com/fwlink/?LinkId=532496Microsoft Visual Studio 2015 Express for Desktop
Web Installer:
http://go.microsoft.com/fwlink/?LinkID= ... lcid=0x409Microsoft Visual Studio Community 2015
Web Installer:
https://www.visualstudio.com/en-us/prod ... ty-vs.aspx
(Choose custom type of installation, unselect all options and then select only Common Tools for Visual C++ 2015)
Optional: Update 1 for Visual Studio 2015
Web Installer:
http://go.microsoft.com/fwlink/?LinkId=691129
- 2.1 Download archive with ddnet sources from https://github.com/ddnet/ddnet using "Download zip" button.
2.2 Extract it wherever you want (For example to "C:\ddnet\"). This is will be your project directory.SpoilerShow
- 3.1 Download and install Python 3.x for Windows from: https://www.python.org/downloads/
- 4.1 Download
bam
from https://github.com/matricks/bam using "Download zip" button.
4.2 Extract it wherever you want (For example to "C:\bam\").
4.3 Execute the filemake_win32_msvc.bat
, bam will compile itself.
4.4 Copy the compiled filebam.exe
to your project directory (For example to "C:\ddnet\").
- 5.1 Download
ddnet_visual_studio_project.zip
and extract it to your project directory (For example to "C:\ddnet\"). 5.2 Run the fileddnet.sln
and Visual Studio will open your project.
5.3 Press button "Show all files", right click on "src" folder and press "Include In Project".5.4 Now you can start to edit sources, compile and debug! There are 6 project configurations:SpoilerShowSpoilerShow- 5.4.1 Select
client_release
orserver_release
and pressDebug->Build Solution
in menu (or F7) to build client or server releases.
If everything is ok, compiled files will appear in your project directory.
5.4.2 Selectclient_debug
orserver_debug
and pressDebug->Start Debugging
in menu (or F5) to compile and start debugging client or server.SpoilerShow
server_sql_release
orserver_sql_debug
, you need to:- 5.5.1 Download
Boost C++ Libraries
from http://sourceforge.net/projects/boost/files/boost/
5.5.2 Extract archive toyour_project_directory\other\
(For example to "C:\ddnet\other\"). Rename extracted directory toboost
:5.5.3 DownloadSpoilerShowmsinttypes
from https://code.google.com/p/msinttypes/downloads/list
5.5.4 Extract archive toyour_project_directory\other\
(For example to "C:\ddnet\other\"). Rename extracted directory tomsinttypes
:5.5.5 Now you are able to compile and debug DDNet-Server_sql. But you will also need to install and setup a database server to make your DDNet-Server_sql working as intended:SpoilerShow
MariaDB
(better), https://downloads.mariadb.org/
or
MySQL Community Server
, https://dev.mysql.com/downloads/mysql/
- 5.4.1 Select
- 1.1 If you don't know which version is better to install, I recommend to use
Last edited by milk on Tue Jan 19, 2016 9:45 pm, edited 4 times in total.
Re: How to compile and debug ddnet on Windows in Visual Studio
FAQ:
- Q: I got compilation error in Visual Studio 2010:
LNK1123: failure during conversion to COFF: file invalid or corrupt
Just remove or rename file "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe"
Here is explanation why is it so: http://stackoverflow.com/a/14144713/5720164
Now clean the project and try to compile again.SpoilerShow
Last edited by milk on Tue Jan 19, 2016 9:37 pm, edited 1 time in total.
- kamillentee
- Posts: 687
- Joined: Sat Jul 26, 2014 11:47 pm
- Player profile: http://ddnet.tw/players/kamillentee/
- Clan: |*KoG*|
Re: How to compile and debug ddnet on Windows in Visual Studio
Very nice work ! There is just a tiny thing you should definitely change: https://matricks.github.io/bam/ indeed offers bam-0.4. The problem is that the script thats builds bam does not support any Visual Studio version beyond Visual Studio 10. The download there is simply outdated. Instead use: https://github.com/matricks/bam/archive/master.zip
- Ryozuki
- Posts: 1748
- Joined: Tue Feb 24, 2015 7:28 am
- Location: Catalonia
- Player profile: http://ddnet.tw/players/Ryozuki/
- Mapper profile: http://ddnet.tw/mappers/Ryozuki/
- Clan: Unique
- Website: https://edgarluque.com
- Discord: Ryozuki#2188
Re: How to compile and debug ddnet on Windows in Visual Studio
would be cool if you add that info on the wiki
Re: How to compile and debug ddnet on Windows in Visual Studio
Thank you! Fixed.HMH wrote:Very nice work ! There is just a tiny thing you should definitely change: https://matricks.github.io/bam/ indeed offers bam-0.4. The problem is that the script thats builds bam does not support any Visual Studio version beyond Visual Studio 10. The download there is simply outdated. Instead use: https://github.com/matricks/bam/archive/master.zip
Oh, I forgot about wiki. I'll add this later.Ryozuki wrote:would be cool if you add that info on the wiki
-
- Posts: 430
- Joined: Sun Nov 22, 2015 8:44 pm
- Player profile: http://ddnet.tw/players/pixel
- Mapper profile: https://ddnet.tw/mappers/pixel/
- Clan: Bitfighter
Re: How to compile and debug ddnet on Windows in Visual Studio
Question: Is there a ddnet_visual_studio_project.zip for normal teeworlds? like teeworlds_visual_studio_project.zip????
- justafish
- Posts: 58
- Joined: Sun Dec 18, 2016 7:49 pm
- Location: Sweden
- Player profile: https://ddnet.tw/players/Just%20a%20fish/
Re: How to compile and debug ddnet on Windows in Visual Studio
I have been trying to follow this guide, but I just can't get it to work.
Here is what I get in Visual Studio Express 10.0:
http://pasted.co/aae99a7a
Errors everywhere! Can someone please help me? :/
Here is what I get in Visual Studio Express 10.0:
http://pasted.co/aae99a7a
Errors everywhere! Can someone please help me? :/
Smoking kills. If you're killed, you've lost a very important part of your life.
- deen
- Posts: 3576
- Joined: Mon May 05, 2014 2:30 pm
- Player profile: https://ddnet.org/players/deen/
- Discord: deen#5910
Re: How to compile and debug ddnet on Windows in Visual Studio
The C files should be compiled with a C compiler, not with a C++ one. That's all I can tell though, hopefully someone with Visual Studio experience can chime in.
Re: How to compile and debug ddnet on Windows in Visual Studio
Looks like the scripts for generating the protocol files aren't executed properly. Either call them manually or fix your python setup.
Who is online
Users browsing this forum: No registered users and 6 guests