Latest Posts

Topic: A mixed bag on compiling...

kraileth

Topic Opener
Joined: 2010-03-14, 16:34
Posts: 59
Ranking
Likes to be here
Posted at: 2010-05-20, 02:01

I'm building my own widelands builds from the latest source for a while now - on Ubuntu Karmic. My first successful try was using scons but then I was told to use cmake by simply executing the shell script compile_and_run.sh. It all works well for some time now but it won't generate the locales.

Today I tried compiling WL for windows but I didn't make it far. I followed the guide (http://wl.widelands.org/wiki/BuildingWidelandsUnderWindows/) closely in my WinXP VM but it just won't work. I also found there what I'm meant to do to build the locales. Yet that won't work either.

Now I have two (main) questions:

  1. How to generate the locales using linux? This is not yet mentioned in the wiki (or I'm blind).

  2. Is crosscompiling possible? Can I build widelands.exe from linux? (this would really rock! :)))

Since I followed the steps of the wiki I'll post here what msys tells me when I make all:

===> Creating icon.o for win32
===> Copying configuration files to "src"
===> CXX ../../../src/build_info.cc
In file included from ../../../src/logic/building.h:31,
                 from ../../../src/logic/editor_game_base.h:24,
                 from ../../../src/chat.cc:21:
../../../src/graphics/picture_id.h:22:32: warning: boost/shared_ptr.hpp: No such file or directory
In file included from ../../../src/logic/editor_game_base.h:26,
                 from ../../../src/chat.cc:21:
../../../src/logic/map.h:38:32: warning: boost/scoped_ptr.hpp: No such file or directory
In file included from ../../../src/logic/building.h:31,
                 from ../../../src/logic/editor_game_base.h:24,
                 from ../../../src/chat.cc:21:
../../../src/graphic/picture_id.h:26: error: 'boost' has not been declared
../../../src/graphic/picture_id.h:26: error: expected initializer before '(' token
In file included from ../../../src/logic/editor_game_base.h:24,
                 from ../../../src/chat.cc:21:
../../../src/logic/building.h:72: error: 'PictureID' does not name a type
../../../src/logic/building.h:125: error: 'PictureID' does not name a type
In file included from ../../../src/logic/editor_game_base.h:26,
                 from ../../../src/chat.cc:21:
../../../src/logic/map.h:385: error: 'boost' has not been declared
../../../src/logic/map.h:385: error: ISO C++ forbids declaration of 'scoped_ptr' with no type
../../../src/logic/map.h:385: error: expected ';' before '<' token
../../../src/logic/map.h:396: error: 'PictureID' does not name a type
make: *** [../../native-release/chat.o] Error 1

And the attempt to generate the locales leads to the following:

Traceback (most recent call last):
  File "utils/buildlocale.py", line 20, in (module)
    import buildcat
  File "c:\wl\mingw\widelands\utils\buildcat.py", line 29, in (module)
    SRCVERSION=detect_revision()
  File "c:\wl\mingw\widelands\utils\detect_revision.py", line 79, in detect_revision
    rv = func()
  File "c:\wl\mingw\widelands\utils\detect_revision.py", line 70, in detect_bzr_revision
    revno = run_bzr("revno")
  File "c:\wl\mingw\widelands\utils\detect_revision.py", line 68, in (lambda)
    ["bzr",subcmd], stdout=subprocess.PIPE, cwd=base_path
  File "c:\Python25\lib\subprocess.py", line 594, in __int__
    errread, errwrite)
  File "c:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the specified file

(The windows error was translated by me; it is German on my system)


Top Quote
timowi

Joined: 2009-11-01, 23:08
Posts: 146
Ranking
At home in WL-forums
Location: Germany
Posted at: 2010-05-20, 11:11

Hi,

1.) Locales are build automatically in release builds only. In debug build you can build locales with "make lang"

2.) Cross compiling should be possible. But I think nobody has tried with widelands. It's a lot of work to set up a build environment for that. You are completely on your own there.

The compile error: You miss the boost headers. Install them and make sure widelands finds them.

The second error is caused by detect_revision. It try to find out the source version and it fails because you have no bzr installed. You should install bazaar to get this working.

Timo


Top Quote
kraileth

Topic Opener
Joined: 2010-03-14, 16:34
Posts: 59
Ranking
Likes to be here
Posted at: 2010-05-20, 12:10

Thanks, timowi!

I generated to locales from the source and added the way to do it to the wiki. If cross compiling has not been done yet, I guess it'll take someone knowledgeable in both worlds and with good programming skills. Unfortunately however that's not me. But I guess that it would take a lot of time for little to no real gain, anyway.

For the boost stuff thing: You're right, the directory containing it had slipped somewhere else... Now that it's in place, the compiler get's a lot farther. Now my problem is seemingly that it can't find LUA-stuff. Could you please also tell me which package it is part of? Or is it probably not yet mentioned in the wiki as LUA is a young addition to the game and the wiki article rather old ("You need the following dlls-files (as at July 26th, 2008)")?

Here's the console output:

===> CXX ../../../src/network/netclient.cc
In file included from ../../../src/network/netclient.cc:35:
../../../src/scripting.h:31:19: warning: lua.hpp: No such file or directory
In file included from ../../../src/network/netclient.cc:35:
../../../src/scripting.h:65: error: 'LUA_YIELD' was not declared in this scope
make: *** [../../native-release/network/netclient.o] Error 1

Also bazaar is not yet mentioned in the article. I downloaded the most recent stable version and installed it. Unfortunately there's more to come... face-sad.png Do I have to install it to a certain place or is it a special version that I need? What happened is the following:

Generating reference catalogs:
        po/maps/maps.pot
        po/texts/texts.pot

That's all. Except for an error window opening up. It's headline is "xgettext.exe - Component not found" with the actual error being: "The application could not be started because libgcc_s_dw2-1.dll was not found. Reinstalling the application could solve the problem."

If I click OK, there's a new line in the console:

Failed to call xgettext: [Errno 22] Invalid argument

And then it goes on building, but I CTRL+C'ed it. Or is the error something to simply ignore?


Top Quote
timowi

Joined: 2009-11-01, 23:08
Posts: 146
Ranking
At home in WL-forums
Location: Germany
Posted at: 2010-05-20, 13:02

Hi,

you need to install at least lua 5.1. I do not know if this is mentioned in the wiki already. Lua is a quite new dependency and the wiki pages are outdated in some parts. Even scons is mentioned there which is no more supported since build15.

The second problem seems to be something with your system. Looks like xgettext is not working correctly. As far as I know this is part of glibc. Perhaps it works without that if it can compile the locales, just try it. You should check your installation.

Timo


Top Quote
kraileth

Topic Opener
Joined: 2010-03-14, 16:34
Posts: 59
Ranking
Likes to be here
Posted at: 2010-05-20, 13:44

Allright, thanks again! I downloaded a package that goes by the name of LuaForWindows_v5.1.4-37.exe and installed it. Then I copied the directories lib and include over to my mingw dir. That must be what the compiler wanted. But it seems that this is not enough yet. To me it looks like the compiler is happy, but now linking won't work. This is the last part of what the console tells me:

===> CXX ../../../src/scripting/scripting.cc
===> LD ../../native-release/widelands.exe
c:/wl/mingw/bin/../lib/gcc/mingw32/4.3.2/../../../mingw32/bin/ld.exe: cannot find -llua
collect2: ld returned 1 exit status
make *** [../../native-release/widelands.exe] Error 1

I also added a small note in the wiki that scons building is obsolete now.

The locale thing is not as important for me, as I can build them on linux now. So if it's a problem with my system and solving it is not of any benefit for others, we may as well just put it aside.


Top Quote
timowi

Joined: 2009-11-01, 23:08
Posts: 146
Ranking
At home in WL-forums
Location: Germany
Posted at: 2010-05-20, 13:58

That means the linker does not find the lua library (liblua.dll?). Maybe there was something wrong with copying the lib folder (lua library in a subfolder? needs to be renamed or copied?) or you need to run cmake again so it finds lua.

First try to run cmake again (and look at the output of cmake!). I think cmake did not found lua but anyway created the makefiles.


Top Quote
kraileth

Topic Opener
Joined: 2010-03-14, 16:34
Posts: 59
Ranking
Likes to be here
Posted at: 2010-05-20, 14:58

Hm... There's no liblua.dll file at all in any directory of my lua install. What I have (and have copied) in the /lib dir, are lua5.1.dll, lua5.1.lib, lua51.dll and lua51.lib.

And about runing cmake again - well, I never ran it in first place. It's not mentioned in the windows building wiki at all. I tried to run it now, but it tells me that that command was not found. So I guess, I have to install that as well? Or am I doing something wrong and it is part of mingw or any other program that is already installed? In that case: Do I have to run it in a certain directory for it to work?


Top Quote
timowi

Joined: 2009-11-01, 23:08
Posts: 146
Ranking
At home in WL-forums
Location: Germany
Posted at: 2010-05-20, 15:54

how did you build it then? Where are you makefiles from? Normally you have to run cmake outside of the source directory (e.g. build/compile) and the run make.


Top Quote
timowi

Joined: 2009-11-01, 23:08
Posts: 146
Ranking
At home in WL-forums
Location: Germany
Posted at: 2010-05-20, 16:10

Did you use the files from build/win32/mingw? I do not know if these will work nowadays. This are old files used to compile widelands with mingw. These do not reflect the latest changes and do not use a configuration like cmake. Now cmake support creation of Makefiles for mingw. You should install cmake and try to build with cmake.

Timo


Top Quote
Tino

Joined: 2009-02-20, 17:05
Posts: 252
Ranking
Tribe Member
Location: Somewhere in Germany...
Posted at: 2010-05-20, 17:44

What i've done to get lua to work on windows and build widelands:

  • Downloaded the package http://www.lua.org/ftp/lua-5.1.4.tar.gz
  • extract it
  • edit MAKEFILE line 12: INSTALL_TOP= /usr/local to INSTALL_TOP= /mingw
  • start msys shell and chdir to the lua dir
  • call "make install"

Then widelands should be able to find all headers and libraries. It does only need lua during the build process, llua gets linked statically into the exe. So no need to copy any of the lua.dlls to the widelands binary directory for running it.


Top Quote