Compiling current trunk, Windows

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
k3nny
Posts: 2
Joined: Mon Aug 23, 2010 9:59 pm

Compiling current trunk, Windows

Post by k3nny »

First of all, thanks for creating such a wonderful but small game :)

I want to mention two things concerning the current armagetronad trunk (Rev. 9449) ..

First of all: src/win32/armagetronad.rc

CodeBlocks (10.05) seems to have a problem with specific values for FILEVERSION and PRODUCTVERSION.
Manually changing them leads to a successful build.

Executing ArmagetronAd.exe or armagetronad_dedicated.exe produces the following error:

Code: Select all

ThreadQueue created
Internal error in tConfItemBase::tConfItemBase(const char*, void (*)()) in D:\ar
magetronad-armagetronad_0.3_trunk\armagetronad\src\tools\tConfiguration.cpp:328
:
        Two tConfItems with the same name ZONE_ALPHA_TOGGLE!
Please send a Bug report!
It loops for WIN_ZONE_EXPANSION, WIN_ZONE_INITIAL_SIZE, ZONE_SEGMENTS, ZONE_SEG_LENGTH, ZONE_BOTTOM and ZONE_HEIGTH and finally crashes.

Greetings
User avatar
Z-Man
God & Project Admin
Posts: 11710
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Compiling current trunk, Windows

Post by Z-Man »

The short version of the bad news is that the project files etc. are still for Code::Blocks 1.0.rc2. The long version is that we don't care all that much about keeping windows compilation running, since all active developers are on Unix or the Mac. So you're sort of on your own.

That said, the double symbol error comes from both the old gWinZone.cpp fortress code and the new code from zone/z* getting compiled in. I thought I had fixed it the last time I took care the windows build was working. I may have forgotten to commit/push a change, I'll check. Edit: Nope, the relevant change is in bzr all right. It's disabling gWinZone.cpp compilation via the flags that can exclude files from individual builds instead of removing the file from the project completely, maybe that isn't properly imported by your version. Deleting src/tron/gWinZone.cpp from the projects should do the trick, then.
User avatar
compguygene
Adjust Outside Corner Grinder
Posts: 2346
Joined: Thu Aug 21, 2008 12:09 pm
Location: Cleveland, Ohio
Contact:

Re: Compiling current trunk, Windows

Post by compguygene »

As I recall, isn't epsy working on his cmake branch to improve the overall compilation process, including for windows? Obviously not a today thing, just curious.
Armagetron: It's a video game that people should just play and enjoy :)
https://bit.ly/2KBGYjvCheck out the simple site about TheServerPharm
User avatar
Z-Man
God & Project Admin
Posts: 11710
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Compiling current trunk, Windows

Post by Z-Man »

Yes. And in theory, it should already work; it's just a question of passing the right settings for our dependencies, as detecting those is absolutely impossible on Windows. I wanted to write a batch file compatible with our winlibs package, but got distracted.
User avatar
compguygene
Adjust Outside Corner Grinder
Posts: 2346
Joined: Thu Aug 21, 2008 12:09 pm
Location: Cleveland, Ohio
Contact:

Re: Compiling current trunk, Windows

Post by compguygene »

Thanks for the information. Personally, I would really like to be able to easily compile the latest trunk for a windows client eventually. Once I get caught up with setting up servers for different people, I intend to experiment with a trunk server to try the Trunk Scripting that Voodoo is working on. My first project I want to try with a trunk server is using the current sty branch Luke has, to run a CTF pickup server.
However, I am really curious to try some of the zonesV2 stuff, and see how it works on my best PC in the house. Unfortunately, it's my wife's PC, and by mutual agreement, I promised her not to install Linux on it. :( This of course is just more proof of how much I love her. Every other PC in the house is a dual boot setup, Windoze and Ubuntu.
Armagetron: It's a video game that people should just play and enjoy :)
https://bit.ly/2KBGYjvCheck out the simple site about TheServerPharm
k3nny
Posts: 2
Joined: Mon Aug 23, 2010 9:59 pm

Re: Compiling current trunk, Windows

Post by k3nny »

Then I got something for you..

The .cbp files for CodeBlocks in winlibs (winlibs\win32\code_blocks) contain some improper filename extensions in the output/include sections.
libvorbis, libvorbisfile, SDL_image, SDL_mixer and mikmod are affected and require some renaming to successfully compile the workspace provided by the trunk.

I uploaded the modified project files, hope you can use them.

EDIT: Deleting src/tron/gWinZone.cpp from the projects was the solution, thanks.
Attachments
code_blocks.rar
Modified CodeBlocks project files
(8.1 KiB) Downloaded 210 times
User avatar
compguygene
Adjust Outside Corner Grinder
Posts: 2346
Joined: Thu Aug 21, 2008 12:09 pm
Location: Cleveland, Ohio
Contact:

Re: Compiling current trunk, Windows

Post by compguygene »

W00t! I will add it to my very long list of tron to-do's! Thank you for taking the time to upload the updated project files.
Armagetron: It's a video game that people should just play and enjoy :)
https://bit.ly/2KBGYjvCheck out the simple site about TheServerPharm
User avatar
clime
On Lightcycle Grid
Posts: 10
Joined: Mon Feb 15, 2010 9:53 pm
Contact:

Re: Compiling current trunk, Windows

Post by clime »

Here is a step-by-step manual how to build trunk on windows these days. It is written so that also a nonprogrammer should be able to follow (if i didn't forget some step :)).

1) Download project from repository (i used TortoiseSVN)

2) Download and install Code::Blocks with mingw (i used version 10.05)

3) Download and install Python (i used version 2.7.1)

4) In project folder, go to .\armagetronad\trunk\armagetronad\win32 and run update_version.bat. It will probably tell you that python is missing, so..

5) in the same folder, edit python.bat and change SET PYTHON=python.exe to SET PYTHON=<path to python.exe> (in my case: C:\Python27\python.exe). You can now run python.bat to see if everything is allright.

6) Now we will need to setup Google protocol buffers. Still in the same folder, edit protobuf.bat and change command "protoc" to "<path to project folder>\armagetronad\trunk\winlibs\protobuf\bin\protoc.exe" (without quotation marks)

7) Run protobuf.bat and optionally check ..\src\protobuf folder for *.pb.h files. If they are there, everything is cool.

8) Boost in winlibs is outdated which causes building errors. We will update it. Download boost at http://www.boost.org/users/download/. Extract the archive and copy boost subfolder. Go to <path to project folder>\armagetronad\trunk\winlibs\boost\includes, delete the boost subfolder there and insert the newer one you have copied.

9) Before finally entering Code::Blocks, we will update its project files to fix names of link libraries. Download code_blocks.rar - an archive uploaded by k3nny in this thread. Copy all cbp files you will find inside. Then, go to <path to project folder>\armagetronad\trunk\winlibs\win32\code_blocks and replace cbp files there with the ones you have copied.

10) So far so good? Cool, we can now start Code::Blocks. Go to <path to project folder>\armagetronad\trunk\armagetronad\win32\code_blocks and start ArmagetronAd.workspace. Now, in menu, you can Build -> Select Target -> Win32 Release (or debug if you want) and Build -> Build workspace. However, building will fail giving you some errors :(. Here are things you need to fix in source codes...

11) For navigation in source codes, use Managenement toolbar on the left. In Armagetron Advanced -> ... -> src -> tools -> tString.cpp, add #include <time.h> into include section.

12) In tTrueVersion.h at the first line, change the last-fourth number to zero (if there is no fourth number behind comma, add zero there). You will not find this file in Management toolbar. Here is path to the file in explorer: <path to project folder>\armagetronad\trunk\armagetronad\src\tTrueVersion.h

13) Go to FTGL -> Headers -> FTGL -> include -> FTTextureGlyph.h at line 55. Remove " FTTextureGlyph::" label there.

14) In Armagetron Advanced -> ... -> src -> tron -> gMenus.cpp at line 316, insert "bool dirty = true;" and replace "currentScreensetting.useSDL" with just "dirty" at line 321 (of course without quotation marks).

15) Now, compiling should pass. Well done. But linking of client will still fail because of wrong names of link libraries (missing dll suffix) in Armagetron Advanced project. We have fixed that for other projects but not for this one because K3nny's archive doesn't include Armagetron Advanced project file. In attachment, you will find an archive with mine. Replace the project file in <path to project folder>\armagetronad\trunk\armagetronad\win32\code_blocks\ with the one you will find in the archive. If you build the workspace now, everything should pass successfully, but armagetronAd still would not launch giving an error. So..

16) as it has been noted in this thread, you need to remove Armagetron Advanced -> ... -> src -> tron -> gWinZone.cpp from the project. Right click on it and choose Remove file from the project. If you want to build a dedicated server you need to do this for project Dedicated.

17) Build workspace.

18) Now, go to <path to project folder>\armagetronad\trunk\armagetronad\win32 and run make_dist.bat. Then go to <path to project folder>\armagetronad\trunk\armagetronad\build\dist and...

19) enjoy living on the edge :).

Many steps could be ommited if trunk was updated accordingly.

EDIT: if you download trunk from launchpad-bazaar thing (really the latest sources), steps 9, 13, 16 have been done already.
Attachments
ArmagetronAd.zip
(3.58 KiB) Downloaded 195 times
User avatar
Jip
Round Winner
Posts: 397
Joined: Sat Sep 26, 2009 5:32 pm

Re: Compiling current trunk, Windows

Post by Jip »

Thx for your effort. I will try it out.
User avatar
Jip
Round Winner
Posts: 397
Joined: Sat Sep 26, 2009 5:32 pm

Re: Compiling current trunk, Windows

Post by Jip »

I followed exactly your step by step tutorial but it doesnt work.
I am on Windows 7 and got the source from launchpad. Here is the log:

Code: Select all

||=== Armagetron Advanced, Win32 Release ===|
..\..\src\resource\tResourceManager.h|33|error: boost/shared_ptr.hpp: No such file or directory|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\ctype.h|62|error: new declaration 'int isblank(int)'|
..\..\src\defs.h|124|error: ambiguates old declaration 'bool isblank(int)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\ctype.h||In function 'int isblank(int)':|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\ctype.h|168|error: new declaration 'int isblank(int)'|
..\..\src\defs.h|124|error: ambiguates old declaration 'bool isblank(int)'|
..\..\src\resource\tResourceType.h|64|error: 'boost' has not been declared|
..\..\src\resource\tResourceType.h|64|error: ISO C++ forbids declaration of 'shared_ptr' with no type|
..\..\src\resource\tResourceType.h|64|error: typedef name may not be a nested-name-specifier|
..\..\src\resource\tResourceType.h|64|error: expected ';' before '<' token|
..\..\src\resource\tResourceType.h|66|error: 'Reference' does not name a type|
..\..\src\resource\tResourceType.h|85|error: 'Reference' is not a member of 'tResourceType'|
..\..\src\resource\tResourceType.h|85|error: 'Reference' is not a member of 'tResourceType'|
..\..\src\resource\tResourceType.h|85|error: template argument 2 is invalid|
..\..\src\resource\tResourceType.h|85|error: template argument 4 is invalid|
..\..\src\resource\tResourceType.h|85|error: invalid type in declaration before ';' token|
..\..\src\resource\tResourceManager.h|90|error: 'boost' has not been declared|
..\..\src\resource\tResourceManager.h|90|error: ISO C++ forbids declaration of 'shared_ptr' with no type|
..\..\src\resource\tResourceManager.h|90|error: typedef name may not be a nested-name-specifier|
..\..\src\resource\tResourceManager.h|90|error: expected ';' before '<' token|
..\..\src\resource\tResourceManager.h|94|error: 'Reference' does not name a type|
..\..\src\resource\tResourceManager.h|99|error: 'Reference' does not name a type|
||=== Build finished: 21 errors, 0 warnings ===|
I don't have a clue what that all means - any help appreciated.
User avatar
AI-team
Shutout Match Winner
Posts: 1020
Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:

Re: Compiling current trunk, Windows

Post by AI-team »

To fix the "int isblank(int)" error just comment out the function in every file except defs.h
No clue about the rest
  
 
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
 
 
User avatar
Jip
Round Winner
Posts: 397
Joined: Sat Sep 26, 2009 5:32 pm

Re: Compiling current trunk, Windows

Post by Jip »

I figured i copied the boost folder to the wrong location. And commenting the isblank() functions works - thx AI.

Now I just got a few warning, but I guess I can ignore them?
EDIT: guess not. Can't find the .exe :(

Compiler:

Code: Select all

..\..\..\winlibs\ZThread\include\zthread\ThreadedExecutor.h|56|warning: 'ZThread::ThreadedExecutor' has a field 'ZThread::ThreadedExecutor::_impl' whose type uses the anonymous namespace|
D:\armagetron\sources\armagetronad\src\network\nSocket.cpp||In member function 'bool nBasicNetworkSystem::Select(REAL)':|
D:\armagetron\sources\armagetronad\src\network\nSocket.cpp|2645|warning: comparison between signed and unsigned integer expressions|
D:\armagetron\sources\armagetronad\src\network\nSocket.cpp|2653|warning: comparison between signed and unsigned integer expressions|
||=== Build finished: 0 errors, 3 warnings ===|
makedist.bat

Code: Select all

=== Armagetron Advanced ===

+-------------------------------------------------------
| Status report
+-------------------------------------------------------
ok      ..\build\dist\freetype6.dll
missing ..\build\dist\FTGL.dll
ok      ..\build\dist\iconv.dll
ok      ..\build\dist\jpeg.dll
ok      ..\build\dist\libpng13.dll
ok      ..\build\dist\libxml2.dll
missing ..\build\dist\SDL.dll
missing ..\build\dist\SDL_image.dll
missing ..\build\dist\SDL_mixer.dll
ok      ..\build\dist\smpeg.dll
ok      ..\build\dist\zlib1.dll
ok      ..\build\dist\resource\included\Anonymous\polygon\regular\square-1.0.1.aamap.xml

*** WARNING: check for missing files

done!
User avatar
AI-team
Shutout Match Winner
Posts: 1020
Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:

Re: Compiling current trunk, Windows

Post by AI-team »

First of all thank you very much for this detailed and very well working step-by-step guide clime!
I finally managed to successfully compile the trunk :D

But I am wondering why my build is about 1 MB bigger than 0.3_alpha8870 and the font and everything looks so different even though the same font and settings are used.
  
 
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
 
 
User avatar
clime
On Lightcycle Grid
Posts: 10
Joined: Mon Feb 15, 2010 9:53 pm
Contact:

Re: Compiling current trunk, Windows

Post by clime »

Jip, from makedist ouput you have provided, it seems that some libraries (projects in the workspace as libogg, SDL, etc.) have not been built. It should output ok everywhere. Please try to make project Armagetron Advanced (client) active (right click on Armagetron Advanced in Management toolbar and choose Make Active. Then try to build workspace again. Or, at worst, right click on every project listed in the toolbar and build it.

Thx AI-team, I am glad it worked out :).
User avatar
Jip
Round Winner
Posts: 397
Joined: Sat Sep 26, 2009 5:32 pm

Re: Compiling current trunk, Windows

Post by Jip »

Thx, it is working now (the building).
But I cant really use it since it looks like this :(
What am I doing wrong? I dont have this problem when i use epsys build from here or the build from beta.armagetronad.net
EDIT: figured it only happens when i change the screen resolution. This is fixed, when I restart the game. But still, 0.3 feels not "fluent" compared to 0.2.8.3.x
Attachments
screenshot_113.png
Post Reply