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 »

Newer files again... removed because newer ones in SVN

whom is the best to ask for SVN rights? I think I'd like to upload them on my own, and try to add a README to the project folder CodeBlocks containing the whole "What should I download and how to compile" - as it was done for VC9.
Last edited by McShark on April 15th, 2010, 7:29 pm, edited 1 time in total.
User avatar
NarajinX
Posts: 18
Joined: March 26th, 2009, 11:10 pm
Location: Calgary,Alberta

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

Post by NarajinX »

Hi all,

So I've followed the code block way. And it compiled fine.

But when it was time to build I get this warning.
WARNING: Can't read file's timestamp: C:\wesnoth\wesnoth-1.6.2\src\ai_python.cpp
Linking executable: wesnoth_gcc4.exe
mingw32-g++-dw2.exe: .objs\src\ai_python.o: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

I think I know the problem. I'm using an old file which still links to ai_python.cpp .

Can anyone tell me where the newer file is?
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

Newer source and project files can be found at SVN: projectfiles/CodeBlocks
If there is a file missing or an old file left, you can add it/remove it from the project file via Code::Blocks.
User avatar
NarajinX
Posts: 18
Joined: March 26th, 2009, 11:10 pm
Location: Calgary,Alberta

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

Post by NarajinX »

Thanks! :)

Kinda figured out my own mistake.

Ok, so get this fribidi error. I read earlier and it just says to remove it from the .cbp file, so I did.

And after other small errors , I still get this
ld.exe||cannot find -lfribidi|
||=== Build finished: 1 errors, 0 warnings ===|
Any thoughts?
User avatar
NarajinX
Posts: 18
Joined: March 26th, 2009, 11:10 pm
Location: Calgary,Alberta

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

Post by NarajinX »

Fixed all the problems and able to compile properly. Just going to try out some more things.

Gonna post a complete and detail guide shortly.
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 »

loonycyborg wrote:Both SDL_ttf(not SDL and other SDL_* libs) and fribidi deps will be dropped in 1.6 unless some nasty bug prevents pango integration from succeeding.
Because we have 1.6.4 and 1.7.1 (Devel): Should these two #defines and libs be removed from project files and dlls from local wesnoth dir? If yes: Shouldn't the #defines be wiped out of the source?

McShark

BTW: What do you think of changing Codeblocks / Codeblocks-Scons project files for generating libwesnoth (like done in the VC9 project files)? Who can do the necessary stuff to make the scons-target wesnothlib?
ilor
Inactive Developer
Posts: 129
Joined: March 24th, 2008, 9:05 pm

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

Post by ilor »

McShark: scons already does the "lib" thing, MSVC was in a stupid position where it compiled the same source files for wesnoth and then for wesnothd, sometimes commiting build suicide in the process if both projects were being built.
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

The project files for Codeblock-Scons are not updated yet, there are only the targets wesnoth and wesnothd. If you tell me how the new target for wesnothlib is called I can upload new ones (according to the changes of VC9 files). Where are the finition of the targets for scons?

What do you know about hte other mentioned points? If fridibi is only used for RTL-font-support, it seems to be removable in the code (who would be the right person to do so?). At least in the language selection menu, RTL works without fridibi, too.

McShark
User avatar
loonycyborg
Windows Packager
Posts: 295
Joined: April 1st, 2008, 4:45 pm
Location: Russia/Moscow

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

Post by loonycyborg »

McShark wrote:The project files for Codeblock-Scons are not updated yet, there are only the targets wesnoth and wesnothd. If you tell me how the new target for wesnothlib is called I can upload new ones (according to the changes of VC9 files). Where are the finition of the targets for scons?
There's no need to add wesnothlib to Codeblock-Scons. Its only purpose is to prevent IDEs from compiling same files twice for wesnoth and wesnothd . SCons doesn't have that issue. It already has functionality to build intermediate libs. codeblocks-scons projectfiles should do only to things: contain all sources so they show up in the ide 2. invoke scons to build wesnoth or wesnothd. The build process itself is specified in sconstruct/sconscript files. Files added to project don't affect it.
At least in the language selection menu, RTL works without fridibi, too.
That's because it's already converted to use pango.
"meh." - zookeeper
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

OK, we leave project files as they are (Code::Blocks compiles fine).
Does every code line has to be converted to pango step by step (is there a progress list for this change)?
Can you tell me something about the need of SDL_ttf?

McShark
orondf
Posts: 17
Joined: November 20th, 2009, 12:52 pm

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

Post by orondf »

Hi.

I tried to compile Wesnoth 1.7.8 with Code::Blocks on Windows XP Pro SP3, and got some errors and warnings. Here are the critical errors:

Linking executable: ..\..\wesnoth.exe
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x28d5): undefined reference to `gui2::event::tdistributor::~tdistributor()'
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x2cf1): undefined reference to `gui2::event::tdistributor::~tdistributor()'
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x30f2): undefined reference to `gui2::event::tdistributor::~tdistributor()'
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x3744): undefined reference to `gui2::event::tdistributor::tdistributor(gui2::twidget&, gui2::event::tdispatcher::tposition)'
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x4739): undefined reference to `gui2::event::tdistributor::tdistributor(gui2::twidget&, gui2::event::tdispatcher::tposition)'
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x12a): undefined reference to `gui2::event::tdistributor::keyboard_remove_from_chain(gui2::twidget*)'
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x168): undefined reference to `gui2::event::tdistributor::keyboard_add_to_chain(gui2::twidget*)'
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x1a6): undefined reference to `gui2::event::tdistributor::keyboard_capture(gui2::twidget*)'
.objs-release\src\gui\widgets\window.o:window.cpp:(.text+0x1ed): undefined reference to `gui2::event::tmouse_motion::capture_mouse(bool)'
collect2: ld returned 1 exit status
Process terminated with status 1 (67 minutes, 57 seconds)
9 errors, 4 warnings

Could you help me solve these problems?
P.S.:I've attached the full log, with some warnings not mentioned in the above.
Attachments
codeblocks wesnoth error.txt
Full Code::Blocks log.
(15.23 KiB) Downloaded 729 times
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

Add the two files ..\..\src\gui\auxiliary\event\distributor.cpp + hpp to wesnoth, that should do the trick.
McShark
Dunmord
Posts: 1
Joined: January 17th, 2010, 5:32 pm

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

Post by Dunmord »

Hello everyone.

I'm trying to compile Wesnoth on code::Blocks/Windows (tried earlier with Dev-c++ but then I found code::Blocks) but I keep getting errors with tdispatcher_implementation. I feel that I'm missing something very basic.

Specs:
IDE: code:Blocks.
Boost version: 1:33.1
Wesnoth Version: 1.7.11-1.
Errors: Most are related to tdispatcher_implementation (I've attached the Log)

I'm using the prepared pack posted on an earlier posts of this thread.
I installed most of the libraries with the Dev-packs/packman.

I read on other threads that Wesnoth works with older versions of boost, thats why I didnt bother to update boost. Could that be the problem or am I overlooking a linker directive/library?

Edit: Ill post the results as soon as I get them.
Attachments
errors.txt
code:Blocks build messages
(38.54 KiB) Downloaded 570 times
Last edited by Dunmord on January 20th, 2010, 4:13 pm, edited 1 time in total.
User avatar
McShark
Posts: 76
Joined: March 19th, 2008, 10:41 pm

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

Post by McShark »

I'm using Boost 1.37.0, everything works fine. Maybe you want to try using current boost version and/or compiling from latest SVN?

McShark
User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

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

Post by Crab »

Successfully compiled using CodeBlocks today. Needed to:
1) use instructions from here, used libs (std package and lua package) from here
2) grab fontconfig library, using binary from http://www.gtk.org/download-windows.html
3) rename a few libs (add version suffix)
4) grab intl.dll from wesnoth distribution
5) fix a few stale files in project (already committed the changes to project file)
Locked