How to compile Wesnoth on Windows with Dev-Cpp, Code::Blocks

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Locked
csarmi
Posts: 288
Joined: August 13th, 2007, 1:57 pm

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by csarmi »

I removed 4.6.1 and installed 4.5.2 instead. I think that something is missing here, because I've got even more error messages:
Spoiler:
Well, I think it was stupid to assume that my half-ready build (built with 4.6.1) would finish cleanly with 4.5.2. I decided to clean the workspace, update SVN, reinstall 4.5.2. to a different directory (just for safety measure, I think my installer removed files just fine) and rebuild the whole project.

Build is running now :)

UPDATE: I need to go afk for a while so I won't see how my install went for a few hours. I just leave it running.
Spoiler:
It did work now, I only got warnings. Will check later how it works :)

A question about SVN: how do I figure out which revision is 1.9.9. (or 1.9.10.) for example? I can see revision numbers only.

Compiling: if I update SVN (a new release comes out) and I want to build/compile wesnoth again, do I have to rebuild workspace? How do I set where I would like to see my userdata directory? How do I apply a patch (like here: #18892 [Gna.org]
Last edited by csarmi on November 10th, 2011, 6:35 am, edited 3 times in total.
SigurdFireDragon
Developer
Posts: 558
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by SigurdFireDragon »

Select "Clean Workspace" then try "Build Workspace" again
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
csarmi
Posts: 288
Joined: August 13th, 2007, 1:57 pm

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by csarmi »

Hah, I got Ninja'd :) Or I'm not sure who did. Yea, doing just that, had some time to think it over while taking my breakfast :)

It did work. See my post above. Of course my version is 1.9.10+SVN now, but it does feel great.

Now I did this for three reasons:

1) I'd like to be able to do something if I experience a bug. I still don't know how to test, check, debug, etc. Is there a way to run my wesnoth in debug mode?

2) I'd like to be able to watch some 1.9.9 replays without my computer hanging up. I think I'll be able to do that now, I'll go back to 1.9.9 release and apply the replay patch and compile (I don't know how patches work yet exactly, but I think I can correct the code by hand in the worst case). If I do compile it fine, does that mean it would work for others too? I mean others with windows.

3) I just wanted to do it to ee if I can. Compiling a game is fun :)

Thaks a lot for the help.
orondf
Posts: 17
Joined: November 20th, 2009, 12:52 pm

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by orondf »

It would be nice if someone could upload an updated version of intl.dll ...
I have 12Mb internet but i have problems downloading and it will take me 4+ hours to download wesnoth 1.9.10.
I tried using intl.dll from version 1.8.6 which I have but i get an error message - I attached a screenshot.
Is this because I need the intl.dll file from wesnoth 1.9.10?

EDIT: Forgot to mention that I compiled wesnoth using instructions for CodeBlocks in readme.txt; compiled successfully without any problems.
Attachments
intl-dll-error-186.jpg
intl-dll-error-186.jpg (14.15 KiB) Viewed 7997 times
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by Anonymissimus »

orondf wrote:Is this because I need the intl.dll file from wesnoth 1.9.10?
Probably.
Alternatively you can try to search for a missing dll on the internet, download it from some site like dll-files.com or so and put it into the program's execution directory. This works not only with wesnoth.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
orondf
Posts: 17
Joined: November 20th, 2009, 12:52 pm

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by orondf »

I have searched but the only version I found is older (0.12.0.0 44kB) and I get the same error from it. (note: intl.dll from 1.8.6 is 0.17.0.0 103kB)...
Can you please upload it so I don't have to wait ages for 1.9.10 to download?
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by Anonymissimus »

The one I use with trunk. Probably got from some 1.9.x distribution.
Attachments
intl.zip
(67.03 KiB) Downloaded 589 times
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
orondf
Posts: 17
Joined: November 20th, 2009, 12:52 pm

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by orondf »

Thanks, now it works. :D
The file you attached is newer, ver. 0.18.1.0 (149kB).
SigurdFireDragon
Developer
Posts: 558
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by SigurdFireDragon »

Compiling trunk with Codeblocks broke for me upon 55530: 'Merge branch bzip2'. Errors are a bunch of undefined things. (45 total).
I'm fairly sure the solution involves updating boost.

With regards to the Codeblocks build instructions in trunk:
I tried replacing the boost folder in CodeBlocks\include_tdm_gcc with the appropriate one from boost 1.51.0, however that doesn't appear to be enough. I see that there are boost.a files in CodeBlocks\lib_tdm_gcc, but I'm not sure where/how to get/make the replacements.

Or I might be a bit farther off. Anyone have any ideas to point me in the right direction?
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
AI
Inactive Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by AI »

That change (sorry about the commit message, it was something like 10 commits that git-svn collapsed) added a dependency. In addition to libz (for gzip), we now require libbz2 (bzip2).
SigurdFireDragon
Developer
Posts: 558
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by SigurdFireDragon »

Ok, tried a few things but it’s still not working.

Got 1.0.6 of bzip2 from http://sourceforge.net/projects/mingw/f ... 2-1.0.6-4/

Placed bzlib.h into my CB includes folder
Placed libbz2.a & libbz2.dll.a into my CB lib folder
Added lines for the .a files into my CB project file
Placed libbz2-2.dll into the folder where Wesnoth.exe would be made.

But I’m still getting a bunch of undefined reference errors like the following:
undefined reference to `boost::iostreams::detail::bzip2_base::bzip2_base(boost::iostreams::bzip2_params const&)'|

Should I upgrade from tdm-gcc 4.5.2 to 4.6 or 4.7?
Should I upgrade boost from 1.46?
Something else perhaps?
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by Anonymissimus »

I'm currently waiting for loonycyborg to make the next release until I deal with updating my MingGw system...
I could update MSVC without a lot of problems, and that's enough to keep the code up-to-date as most win-only problems happen in MSVC.
If you manage to update it quicker you perhaps can take maintenance. You probably need to recompile the boost .as, using same compiler as for the project. I wouldn't change the compiler, last time I tried that it caused linker errors.
It seems that the neccessary boost_bzip2 stuff which I needed in MSVC was only added to boost in one of the newer boost versions, perhaps 1.46 doesn't yet have it.

EDIT
There's some related talk and links on irc #wesnoth-dev about 10.09.2012 0.00
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
loonycyborg
Windows Packager
Posts: 299
Joined: April 1st, 2008, 4:45 pm
Location: Russia/Moscow

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by loonycyborg »

Here's how I've built boost.iostreams with bzip2 support:
Installed bzip2 from http://gnuwin32.sourceforge.net/packages/bzip2.htm using the first installer there
then ran from cmd.exe from boost's dir

Code: Select all

set BZIP2_SOURCE="d:\Program Files\GnuWin32\include"
set ZLIB_SOURCE="d:\GTK-DEV\include"
bjam --with-iostreams -sNO_ZLIB=0 -sNO_BZIP2=0
If the boost library is static then the whole app that links against it must link against bz2 from the bzip2 package too, and in all cases you'll need bzip2.dll at runtime.
"meh." - zookeeper
SigurdFireDragon
Developer
Posts: 558
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by SigurdFireDragon »

I have managed to obtain the boost.iostreams. ;)

Got the http://gnuwin32.sourceforge.net/packages/bzip2.htm

Placed the new libboost_iostreams-mgw45-mt-1_46_1.a into my CB lib folder
Placed bzlib.h into my CB includes folder
Placed libbz2.a & libbz2.dll.a into my CB lib folder
Added lines for the .a files into my CB project file
Placed bzip2.dll into the folder where Wesnoth.exe would be made.

Those where the only changes I made.

I got wesnoth.exe to compile & run with r55658, however, wesnothd.exe threw the following errors:

Code: Select all

||=== wesnothd, Release ===|
C:\Battle for Wesnoth Trunk\src\server\server.cpp|493|warning: #warning "No FIFODIR set"|
||warning: duplicate section `.rdata$_ZTIN5boost10error_infoIN7network13tag_tcpsocketEP10_TCPsocketEE[typeinfo for boost::error_info<network::tag_tcpsocket, _TCPsocket*>]' has different size|
C:\Program Files (x86)\CodeBlocks\lib_tdm_gcc\libboost_iostreams-mgw45-mt-1_46_1.a(bzip2.o):bzip2.cpp|| undefined reference to `BZ2_bzDecompressInit'|
C:\Program Files (x86)\CodeBlocks\lib_tdm_gcc\libboost_iostreams-mgw45-mt-1_46_1.a(bzip2.o):bzip2.cpp|| undefined reference to `BZ2_bzCompressInit'|
C:\Program Files (x86)\CodeBlocks\lib_tdm_gcc\libboost_iostreams-mgw45-mt-1_46_1.a(bzip2.o):bzip2.cpp|| undefined reference to `BZ2_bzDecompressEnd'|
C:\Program Files (x86)\CodeBlocks\lib_tdm_gcc\libboost_iostreams-mgw45-mt-1_46_1.a(bzip2.o):bzip2.cpp|| undefined reference to `BZ2_bzCompressEnd'|
C:\Program Files (x86)\CodeBlocks\lib_tdm_gcc\libboost_iostreams-mgw45-mt-1_46_1.a(bzip2.o):bzip2.cpp|| undefined reference to `BZ2_bzCompress'|
C:\Program Files (x86)\CodeBlocks\lib_tdm_gcc\libboost_iostreams-mgw45-mt-1_46_1.a(bzip2.o):bzip2.cpp|| undefined reference to `BZ2_bzDecompress'|
||=== Build finished: 6 errors, 12 warnings ===|
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
User avatar
loonycyborg
Windows Packager
Posts: 299
Joined: April 1st, 2008, 4:45 pm
Location: Russia/Moscow

Re: How to compile Wesnoth on Windows with Dev-Cpp, Code::Bl

Post by loonycyborg »

Looks like it isn't linked against libbz2.
"meh." - zookeeper
Locked