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
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 followed your instructions, but I still get the same errors.
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've updated the project files for 1.9.0+svn. Please download and try again.
The includes lauxlib.h lua.h lua.hpp luaconf.h lualib.h, the libs lua5.1.lib lua51.lib and lua5.1.dll lua51.dll should no longer be needed.
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 »

Hi,
I have downloaded the latest SVN and rebuilded, but I got the errors again.
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 »

Exactly the same ? Post them.

I don't know why it works for me but not for you in the first place.
Do you have a file named liblua.a in your projectfiles\CodeBlocks directory ?
EDIT: A wild guess - do you open only the wesnoth.cbp project file and build that instead of wesnoth.workspace and building the whole workspace ? In that case you'll get those linker errors I'm guessing.

Do you have liblua in properties>project's build options>linker settings>link libraries for project wesnoth ? It should be there since this should be in the project file.
Do you have mingw32-g++-dw2.exe in settings>compiler and debugger>global compiler settings>toolchain executables>c compiler ? The lua c files in project liblua don't compile otherwise.

On a general note, compiling something should always be considered an *EXTREMELY* tough task. You are expected to try *LOTS* of things by yourself and invest *TIME*. If you don't want to or can't do that then don't try. This is not a "you are presented something ready to go" - issue. I needed a month and 20 trials or so to get wesnoth 1.8 to compile with the messed up 1.8 VS studio project file.
As an alternative, you can try VS Express. Both the cmake and the standalone project file versions are supposed to work. The libraries from the external folder for the cmake version work for the standalone projeft file for me too.
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
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 »

Recently this build environment got broken by some changes to trunk. I decided set it up with a new compiler (the same used for current releases) and many of the dependencies updated. Thx to loonycyborg's help it is now available again; infos are in projectfiles/CodeBlocks/README.txt in the source.
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
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 »

The readme.txt there is a nice and easy read. However, it doesn't work for me.
When I try to build, I get the messages:

"liblua - Release" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
"wesnoth - Release" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
"wesnothd - Release" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.

I downloaded and installed tdm-gcc-4.6.1 (all packages) and CodeBlocks 10.05 (all packages)

I have put the Codeblocks SDK (indicated in the readme file) into Codeblocks_root like I was told:

"c:\Program Files (x86)\CodeBlocks\include_tdm_gcc"
"c:\Program Files (x86)\CodeBlocks\lib_tdm_gcc"

I attached a screenshot for my global compiler setting.

I must be missing something very basic, but I don't see what. Anyone can help me?

Thanks in advance,

Máté
Attachments
Search directories
Search directories
Global Compiler settings
Global Compiler settings
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'm stupid alright. My directory is C:\mingw32, not c:\mingw

trying again :)
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 »

This is what I'm getting now:

||=== wesnoth, Release ===|
||warning: duplicate section `.data$_ZZN5boost9function1IvPN4gui27twidgetEE9assign_toIPFvS3_EEEvT_E13stored_vtable[void boost::function1<void, gui2::twidget*>::assign_to<void (*)(gui2::twidget*)>(void (*)(gui2::twidget*))::stored_vtable]' has different size|
||warning: duplicate section `.data$_ZGVZN5boost4asio5error17get_misc_categoryEvE8instance[guard variable for boost::asio::error::get_misc_category()::instance]' has different size|
||warning: duplicate section `.data$_ZGVN5boost4asio6detail12service_baseINS1_15task_io_serviceEE2idE[guard variable for boost::asio::detail::service_base<boost::asio::detail::task_io_service>::id]' has different size|
||warning: duplicate section `.data$_ZZN5boost9function1IvPN4gui27twidgetEE9assign_toIPFvS3_EEEvT_E13stored_vtable[void boost::function1<void, gui2::twidget*>::assign_to<void (*)(gui2::twidget*)>(void (*)(gui2::twidget*))::stored_vtable]' has different size|
||warning: duplicate section `.data$_ZGVZN5boost4asio5error17get_misc_categoryEvE8instance[guard variable for boost::asio::error::get_misc_category()::instance]' has different size|
ld.exe||cannot find -lSDLmain|
ld.exe||cannot find -lSDL|
ld.exe||cannot find -lSDL_image|
ld.exe||cannot find -lSDL_net|
ld.exe||cannot find -lSDL_mixer|
ld.exe||cannot find -lSDL_ttf|
ld.exe||cannot find -lfreetype|
ld.exe||cannot find -lintl|
ld.exe||cannot find -lz|
ld.exe||cannot find -lpango-1.0|
ld.exe||cannot find -lpangocairo-1.0|
ld.exe||cannot find -lcairo|
ld.exe||cannot find -lgobject-2.0|
ld.exe||cannot find -lfontconfig|
ld.exe||cannot find -lglib-2.0|
ld.exe||cannot find -lboost_iostreams-mgw45-mt-1_46_1|
ld.exe||cannot find -lboost_program_options-mgw45-mt-1_46_1|
ld.exe||cannot find -lboost_regex-mgw45-mt-1_46_1|
ld.exe||cannot find -lboost_system-mgw45-mt-1_46_1|
ld.exe||cannot find -lboost_thread-mgw45-mt-1_46_1|
ld.exe||cannot find -lz.dll|
||=== Build finished: 21 errors, 5 warnings ===|

I should learn to read :)

I need to put the linker directory under the linker tab, and the include directory under the compile tab (I accidentally put both directories under the compile tab).

It still gave me some error messages though.

Thse ones:

||=== wesnoth, Release ===|
||warning: duplicate section `.data$_ZZN5boost9function1IvPN4gui27twidgetEE9assign_toIPFvS3_EEEvT_E13stored_vtable[void boost::function1<void, gui2::twidget*>::assign_to<void (*)(gui2::twidget*)>(void (*)(gui2::twidget*))::stored_vtable]' has different size|
||warning: duplicate section `.data$_ZGVZN5boost4asio5error17get_misc_categoryEvE8instance[guard variable for boost::asio::error::get_misc_category()::instance]' has different size|
||warning: duplicate section `.data$_ZGVN5boost4asio6detail12service_baseINS1_15task_io_serviceEE2idE[guard variable for boost::asio::detail::service_base<boost::asio::detail::task_io_service>::id]' has different size|
||warning: duplicate section `.data$_ZZN5boost9function1IvPN4gui27twidgetEE9assign_toIPFvS3_EEEvT_E13stored_vtable[void boost::function1<void, gui2::twidget*>::assign_to<void (*)(gui2::twidget*)>(void (*)(gui2::twidget*))::stored_vtable]' has different size|
||warning: duplicate section `.data$_ZGVZN5boost4asio5error17get_misc_categoryEvE8instance[guard variable for boost::asio::error::get_misc_category()::instance]' has different size|
||warning: duplicate section `.data$_ZGVZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty[guard variable for std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool)::|
||warning: duplicate section `.data$_ZZN5boost15program_options10validators17get_single_stringIcEERKSbIT_St11char_traitsIS3_ESaIS3_EERKSt6vectorIS7_SaIS7_EEbE5empty[std::basic_string<char, std::char_traits<char>, std::allocator<char> > const& boost::program_options::validators::get_single_string<char>(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool)::empty]' has different|
||warning: duplicate section `.data$_ZGVZN5boost12object_cacheINS_9re_detail21cpp_regex_traits_baseIcEENS1_31cpp_regex_traits_implementationIcEEE6do_getERKS3_jE6s_data[guard variable for boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>, boost::re_detail::cpp_regex_traits_implementation<char> >::do_get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned int)::s_data]' has different size|
||warning: duplicate section `.data$_ZGVZN5boost9re_detail31cpp_regex_traits_implementationIcE4initEvE11null_string[guard variable for boost::re_detail::cpp_regex_traits_implementation<char>::init()::null_string]' has different size|
||warning: duplicate section `.data$_ZZN5boost9re_detail31cpp_regex_traits_implementationIcE4initEvE11null_string[boost::re_detail::cpp_regex_traits_implementation<char>::init()::null_string]' has different size|
||warning: duplicate section `.data$_ZZN5boost16cpp_regex_traitsIcE21get_catalog_name_instEvE6s_name[boost::cpp_regex_traits<char>::get_catalog_name_inst()::s_name]' has different size|
||warning: duplicate section `.data$_ZZN5boost9re_detail20get_default_class_idIcEEiPKT_S4_E10ranges_end[int boost::re_detail::get_default_class_id<char>(char const*, char const*)::ranges_end]' has different size|
||warning: duplicate section `.data$_ZZN5boost9re_detail20get_default_class_idIcEEiPKT_S4_E12ranges_begin[int boost::re_detail::get_default_class_id<char>(char const*, char const*)::ranges_begin]' has different size|
||warning: duplicate section `.data$_ZZN5boost16cpp_regex_traitsIcE21get_catalog_name_instEvE6s_name[boost::cpp_regex_traits<char>::get_catalog_name_inst()::s_name]' has different size|
c:\mingw32\bin\..\lib\gcc\mingw32\4.6.1\libstdc++.a(stdexcept.o):stdexcept.cc|| multiple definition of `std::invalid_argument::~invalid_argument()'|
c:\mingw32\bin\..\lib\gcc\mingw32\4.6.1\libstdc++.a(stdexcept.o):stdexcept.cc|| multiple definition of `std::overflow_error::~overflow_error()'|
c:\mingw32\bin\..\lib\gcc\mingw32\4.6.1\libstdc++.a(stdexcept.o):stdexcept.cc|| multiple definition of `std::invalid_argument::~invalid_argument()'|
c:\mingw32\bin\..\lib\gcc\mingw32\4.6.1\libstdc++.a(stdexcept.o):stdexcept.cc|| multiple definition of `std::overflow_error::~overflow_error()'|
||=== Build finished: 4 errors, 14 warnings ===|
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 »

csarmi wrote: c:\mingw32\bin\..\lib\gcc\mingw32\4.6.1\libstdc++.a(stdexcept.o):stdexcept.cc|| multiple definition of `std::invalid_argument::~invalid_argument()'|
c:\mingw32\bin\..\lib\gcc\mingw32\4.6.1\libstdc++.a(stdexcept.o):stdexcept.cc|| multiple definition of `std::overflow_error::~overflow_error()'|
c:\mingw32\bin\..\lib\gcc\mingw32\4.6.1\libstdc++.a(stdexcept.o):stdexcept.cc|| multiple definition of `std::invalid_argument::~invalid_argument()'|
c:\mingw32\bin\..\lib\gcc\mingw32\4.6.1\libstdc++.a(stdexcept.o):stdexcept.cc|| multiple definition of `std::overflow_error::~overflow_error()'|
||=== Build finished: 4 errors, 14 warnings ===|
These are the same errors Espreon showed to me when he tried compiling with this method in his VM win7 installation. So obviously there's some general problem worth looking at. I guess I'll try reproducing these.
loonycyborg wrote:I'd say it's either broken itself or there's a redundant lib somewhere.
You can try building a simple C++ program. Maybe something like "#include <stdexcept>\nint main() {throw std::invalid_argument(); }
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
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 »

Indeed. I've searched for these error messages on the next and found them on pastebin :)
So that way you guys.

Well, letme know if there's anything I can try, or if there is anything I can add. I do have some programming experience and background, but it's been a long time since I've last touched a low level language and I'm not familiar with the development environments, but I should understand instructions just fine. :)
SigurdFireDragon
Developer
Posts: 546
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'm pretty sure the problem is related to tdm-gcc-4.6.1, note that the CodeBlocks Instructions specify tdm-gcc-4.5.2.

I remember I tried compiling with 4.6.1 a while back as a test, and finding it didn't work, went back to using 4.5.2
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 »

Well, the readme was created a long time ago and I supposed that a higher version named should be better, usually. I'll try with 4.5.2 too - if I manage to get that somewhere.

I don't have a clue how to get tdm-gcc 4.5.2. :(
SigurdFireDragon
Developer
Posts: 546
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 »

Go here and scroll to the bottom of the page:
http://tdm-gcc.tdragon.net/download

Yeah usually newer is better.

Also, for those who might be interested, Note that if you're making a debug build, the gdb.exe with 4.5.2 doesn't quite work with some of the debug commands, so currently you'd need to compile with 4.5.2 and get a more recent copy of gdb.
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 »

Yea I did find that page (scrolled down), but I could find some packages there that don't make sense to me. Not a single one with installer. I just don't know what to do with them. DL all and copy them into the same directory? (4.6.1 had a nice installer, btw,I do have to uninstall 4.6.1 right?)
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 »

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
Locked