Currently Online

Latest Posts

Topic: Usage of the --homedir option

fuchur
Joined: 2009-10-07, 14:01
Posts: 182
Ranking
Widelands-Forum-Junkie
Location: Germany
Posted at: 2019-05-11, 13:26

Thanks a lot GunChleoc, downgrading boost solved the issue. I just had to replace %MINGWSUFFIX% with x86_64 to get the package.

I'll take care not to mix up the several sources.

I never worked with bzr and the like, so thanks for your hints.

Now ninja aborted with the following error.

[1019/1456] Building CXX object src/CMakeFiles/widelands_ball_of_mud.dir/wlapplication.cc.obj
FAILED: src/CMakeFiles/widelands_ball_of_mud.dir/wlapplication.cc.obj
C:\msys64\mingw64\bin\g++.exe  -DMINGW_HAS_SECURE_API -DSYSTEM_WINDOWS -DUSE_GLBINDING -DWIN32_LEAN_AND_MEAN -D__STDC_FORMAT_MACROS -D__USE_MINGW_ANSI_STDIO -I../src -Isrc -isystem C:/msys64/mingw64/include/SDL2 -g    -std=c++11 -std=gnu++11 -fext-numeric-literals  -g -DDEBUG -Wall -Wpedantic -Wdeprecated-declarations -Wextra -Wformat -Wformat-nonliteral -Wformat-security -Wformat-y2k -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wno-undef -Wold-style-cast -Woverlength-strings -Wpacked -Wpointer-arith -Wsign-promo -Wsync-nand -Wtrampolines -Wundef -Wunused -Wunused-macros -Werror=format-security -Werror=return-type -Werror=shadow -Werror=uninitialized -MD -MT src/CMakeFiles/widelands_ball_of_mud.dir/wlapplication.cc.obj -MF src\CMakeFiles\widelands_ball_of_mud.dir\wlapplication.cc.obj.d -o src/CMakeFiles/widelands_ball_of_mud.dir/wlapplication.cc.obj -c ../src/wlapplication.cc
In file included from ../src/third_party/gettext/gettext.h:25,
                 from ../src/base/i18n.h:27,
                 from ../src/wlapplication.cc:47:
C:/msys64/mingw64/include/boost/system/detail/system_category_win32.hpp: In function 'const char* boost::system::detail::unknown_message_win32(int, char*, std::size_t)':
C:/msys64/mingw64/include/boost/system/detail/system_category_win32.hpp:52:10: error: 'libintl_snprintf' is not a member of 'std'
     std::snprintf( buffer, len, "Unknown error (%d)", ev );
          ^~~~~~~~
C:/msys64/mingw64/include/boost/system/detail/system_category_win32.hpp:52:10: note: suggested alternative:
C:/msys64/mingw64/include/libintl.h:374:12: note:   'libintl_snprintf'
 extern int snprintf (char *, size_t, const char *, ...);
            ^~~~~~~~
[1020/1456] Building CXX object src/ai/CMakeFiles/ai.dir/ai_help_structs.cc.obj
[1021/1456] Building CXX object src/ai/CMakeFiles/ai.dir/defaultai_warfare.cc.obj
ninja: build stopped: subcommand failed.

That looks more like an error in boost. Do I need to downgrade to another older version?

I tried that with current trunk, not with build20. And I run a debug build. But the same happens for the build20 source from the downloaded archive.

Downgraded boost to 1.68, but I need to leave now. Will try later to compile again.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 567
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-05-11, 16:13

You need to Patch libintl.h the Patch is available in utils i think.
Boost 1.70 works as well with a small change in cmake Commands. The page is not quite up to Date die to the frequent change in Msys. To see which commands to use have a Look into appveyor.yml


Top Quote
fuchur
Joined: 2009-10-07, 14:01
Posts: 182
Ranking
Widelands-Forum-Junkie
Location: Germany
Posted at: 2019-05-12, 15:24

Thanks hessenfarmer. As it compiles now with boost 1.68 I'll keep that at the moment. But I'll keep your information in mind in case I need it some time.

The good news is I can build a widelands.exe from trunk. The bad news is it won't run. Ok, in more detail:

  • The executable can't be started from Windows. It complains about a missing libicuuc64.dll.
  • I can start it from a MSYS shell. But I'm not sure if that is a problem concerning command line options. It seems that there I need to use double \ to get a single \ into the option value.
  • I can use std::cout to print messages
  • Without any command line options the screen turns black for a moment, then I get an exception. The last lines of stdout.txt are concerning SoundHandler. That means basic initialization works.
Caught exception (of type '17FileNotFoundError') in outermost handler!
The exception said: LayeredFileSystem: Could not load file: could not find file or directory: shaders/workarea.fp
  • With a command line option it aborts with a Segmenation fault. Now I'm trying to find out where that comes from.

Edit: Ok, I think I found the reason for the segmentation fault. In wlapplication.cc there is a call to log() before the logger is initialized.

    parse_commandline(argc, argv);  // throws ParameterError, handled by main.cc

    if (commandline_.count("homedir")) {
        log("Adding home directory: %s\n", commandline_["homedir"].c_str());   // <----- call of log() before it is initialized.
        homedir_ = commandline_["homedir"];
        commandline_.erase("homedir");
    }
#ifdef REDIRECT_OUTPUT
    if (!redirect_output())
        redirect_output(homedir_);
#endif

    setup_homedir();   // <----- Windows logger is initialized in this function

Commenting this line solves my homedir problem. Ok, I think the best way is to change it to std::cout as the logger can't be initialized without further tests. But the exception concerning shaders/workarea.fp remains.

Edited: 2019-05-12, 15:43
Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 567
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-05-12, 16:21

the .exe you get by MSYS2 is dynamically linked which means you need to copy all relevan dll files to the installation directory. With all of them present you should be able to do so. Normally I install a trunk version from Appveyor and exchange the exe in this folder with my own compiled exe. So i am sure I have all dll present.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 567
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-05-12, 16:23

Just forgot to mention. On appveyour we use Innosetup to collect all dlls and compile an installer. at list you can have a look at utils folder and search for the .iss file to see which dll are needed. You need to copy the datadir to the installation folder as well.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 2811
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-05-12, 17:12

I have fixed the homedir code directly in trunk, bzr pull to get the update. Thanks for finding that bug!

Regarding shaders/workarea.fp, can you check whether data/shaders/workarea.fp exists in your copy of trunk / in your datadir?

Edited: 2019-05-12, 17:12

Busy indexing nil values

Top Quote
fuchur
Joined: 2009-10-07, 14:01
Posts: 182
Ranking
Widelands-Forum-Junkie
Location: Germany
Posted at: 2019-05-12, 21:18

GunChleoc wrote:

I have fixed the homedir code directly in trunk, bzr pull to get the update. Thanks for finding that bug!

Your're welcome. And thanks for fixing it so quickly. Regarding your comment on launchpad: I'll try to get rid of the other problems which should be no problem due to the hints of hessenfarmer. Then I'll report if it's ok. Unfortunately the next days I'll be quite busy with other things.

Regarding shaders/workarea.fp, can you check whether data/shaders/workarea.fp exists in your copy of trunk / in your datadir?

Yes, it exists in my copy of trunk. It was my fault. I simply copied the built widelands.exe to the installation folder of build20. I assumed as the release was only a few days old there wouldn't be much changes. But obviously I was wrong as there (in build20) is no data/shaders/workarea.fp present.

@hessenfarmer Thanks for clarifying the differences between static and dynamic linking of the different builds. I will follow your advice and install an appveyor build to have a working base for testing.

It seems there are a lot of traps one can fall in. So unfortunately I need to ask all those beginner questions.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 567
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-05-13, 13:53

You're welcome. The Problem with the MSYS2 environment is that it tries to keep up to date libraries which means the windows builds (either in your own MSYS2 or in Appveyor) do experience any problem in our third party libraries first.
So feel free to ask any question. Perhaps the other thread would be more appropriate though. Usually it is a good idea to keep track of any changes in appveyor.yml as well as this is the first location where we need to fix it.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 2811
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-05-13, 19:57

fuchur wrote:

Regarding shaders/workarea.fp, can you check whether data/shaders/workarea.fp exists in your copy of trunk / in your datadir?

Yes, it exists in my copy of trunk. It was my fault. I simply copied the built widelands.exe to the installation folder of build20. I assumed as the release was only a few days old there wouldn't be much changes. But obviously I was wrong as there (in build20) is no data/shaders/workarea.fp present.

You can assume more changes to the data directory in the coming days. The workareas are the fancy new overlay that Nordfriese programmed for us face-smile.png


Busy indexing nil values

Top Quote
fuchur
Joined: 2009-10-07, 14:01
Posts: 182
Ranking
Widelands-Forum-Junkie
Location: Germany
Posted at: 2019-05-13, 22:33

Ok, short update.

I installed an Appveyor build to get the needed DLLs. Using these I can run and test widelands directly from windows command line or a shortcut. Now the --homedir option works like expected, thanks GunChleoc face-smile.png

Edited: 2019-05-13, 22:35
Top Quote