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
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

I've packed the most steps together in one file. It's about 11 MB. Has anyone the space to host the file?
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

@Mist: As you see, all worked fine with a new clear installation. Is it possible to enable other languages than system standard in svn-build on windows?
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

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

Post by Mist »

Yes, that's a known issue with faulty libintl3.dll copy libintl3.dll and iconv.dll from official relase, it utilises older and working version.
Somewhere, between the sacred silence and sleep.
Disorder.
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

So what can we do about the language thing?
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

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

Post by Mist »

Mist wrote:copy libintl3.dll and iconv.dll from official relase
Somewhere, between the sacred silence and sleep.
Disorder.
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

@mist: Thank you, language work's fine now.
@all:

The easy way.

This guide, featuring gcc 4.2, is kind a copy of Mist's one, but has only two downloads. There are some hints and knowledge left out, so if you have problems: take Mist's guide.
  1. Get DevCpp 5.0 beta (4.9.9.2) without MinGw compiler from Sourceforge (about 2,4 MB) and install it somewhere, for example c:\dev-cpp
  2. Get a checkout of the sources and put it somewhere, for example c:\wesnoth
  3. Get prepared dev-cpp pack (about 13 MB) and unpack it. If you can't open it: download and install 7zip (about 1 MB).
    1. Copy contents of dev-cpp to your dev-folder (in example: c:\dev-cpp)
    2. Copy contents of wesnoth folder to your wesnoth folder (in example: c:\wesnoth)
That's it, this is the compiling environment that should allow you to build wesnoth. Open the project file in wesnoth folder (in example: c:\wesnoth\wesnoth_gcc4.dev).

If everything looks ok just hit execute->rebuild.
The End

PS. This recipe is for trunk as of 24.03.2008, things might change in the future. It is recommend to use newer versions of these packs if available. For this, you have to make the appropriate steps of Mist's guide.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

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

Post by AI »

Please do not use tinyurl, I may have preview turned on, but not everyone does and it's annoying not to know where a link leads before you click on it. Also, since preview exists, it is no longer useful for image tags either. (which was it's primary purpose, as signatures are typically limited in length)

[/offtopic]
mihoshi
Posts: 52
Joined: February 16th, 2008, 10:18 pm

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

Post by mihoshi »

McShark wrote: The easy way.
Thanks a lot, that worked fine.

Btw, if someone had Dev-cpp installed before, better remove it and install new one in the same place, or install in different dir and make sure that you set right place in Environment/Dirs/User's Default Directory. Dev-cpp remember settings from previous installations, including this one, had lots of problems because of this.
User avatar
singalen
iOS Port Maintainer
Posts: 314
Joined: January 3rd, 2007, 10:18 am
Location: bay

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

Post by singalen »

Hint for Vista users: if you get "g++.exe: CreateProcess: No such file or directory", add
<Dev-Cpp or mingw directory>\libexec\gcc\mingw32\4.2.1-dw2
to PATH
where 4.2.1-dw2 is your gcc version.
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

Since some versions ago, there is always the following problem:
[Linker error] undefined reference to `gui2::taddon_connect::show(CVideo&)'
ld returned 1 exit status
Does anybody know what can be done to fix this problem?
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

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

Post by Mist »

Mordante is starting to integrate new GUI files. You need to add every .cpp in /src/gui tree to your project. I've noticed that yesterday but didn't have the time to properly update the dev file.
Somewhere, between the sacred silence and sleep.
Disorder.
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

This project file is working now, again (old files/posts were deleted). Download the file and remove ".txt" from file name (The extension dev is not allowed for uploading).
I have no svn-rights on these files, so maybe somebody wants to submit it.
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

Needed for debugging: gdb-6.8-mingw-2

There are newer versions of gnu binutils and gnu make available.
vicza
Posts: 238
Joined: January 16th, 2008, 11:40 pm
Location: Moscow

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

Post by vicza »

Hmm... Today I've tried to compile it in Windows... First I used "The easy way" by McShark, then -- more detailed one by Mist. In any case compilation is stopped with some error. Last time is was this:

Code: Select all

src/ai_village.o  -o "wesnoth.exe" -L"G:/src/Dev-Cpp4/lib" -mwindows -lzdll -lmingw32 -lmingwthrd -lSDLmain -lSDL -lSDL_image -lSDL_net -lSDL_mixer -lwin32k -lfreetype -lintl -mthreads -lpython25 -lpng -lkernel32 -lwsock32 ../Dev-Cpp4/lib/libboost_regex_dw2.a ../Dev-Cpp4/lib/libboost_iostreams_dw2.a ../Dev-Cpp4/lib/libSDL_ttf.a ../Dev-Cpp4/lib/libz.a ../Dev-Cpp4/lib/libjpeg.a  -s 

G:\src\Dev-Cpp4\Bin/ld.exe: cannot find -lzdll
collect2: ld returned 1 exit status

make.exe: *** [wesnoth.exe] Error 1

Execution terminated
What's this zdll and where I can find it?
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

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

Post by Mist »

Check the step about zlib. You can either rename the -lzdll flag in the project linker options to -lz or rename libzdll.a to libz.a and try again.
Somewhere, between the sacred silence and sleep.
Disorder.
Locked