The problem is the windows logger which is initialized in WLApplication::setup_homedir(). But there is a call of log() in WLApplication::WLApplication(int const argc, char const* const* const argv) before that happens. See source below
if (commandline_.count("homedir")) {
log("Adding home directory: %s\n", commandline_["homedir"].c_str()); // <-- this is it
homedir_ = commandline_["homedir"];
commandline_.erase("homedir");
}
#ifdef REDIRECT_OUTPUT
if (!redirect_output())
redirect_output(homedir_);
#endif
setup_homedir();
If the labeled line is changed to print the output using std::cout (maybe encapsuled by #ifdef _WIN32) or commented it works.
Windows doesn't have a stdout if you run a program using a shortcut. Therefore log() writes to a file stdout.txt which is saved in the homedir folder. I guess in Linux starting widelands from a shell stdout is always accessible -> no problem with log() before setting the homedir.
I assume in Linux one should see two messages about the home directory if one uses the homedir option. One stating "Adding home directory:" and the second one "Set home directory:".
The problem is the windows logger which is initialized in WLApplication: :setup_ homedir( ). But there is a call of log() in WLApplication: :WLApplication( int const argc, char const* const* const argv) before that happens. See source below
if (commandline_ .count( "homedir" )) { ["homedir" ].c_str( )); // <-- this is it ["homedir" ]; .erase( "homedir" ); output( )) output( homedir_ );
log("Adding home directory: %s\n", commandline_
homedir_ = commandline_
commandline_
}
#ifdef REDIRECT_OUTPUT
if (!redirect_
redirect_
#endif
setup_homedir();
If the labeled line is changed to print the output using std::cout (maybe encapsuled by #ifdef _WIN32) or commented it works.
Windows doesn't have a stdout if you run a program using a shortcut. Therefore log() writes to a file stdout.txt which is saved in the homedir folder. I guess in Linux starting widelands from a shell stdout is always accessible -> no problem with log() before setting the homedir.
I assume in Linux one should see two messages about the home directory if one uses the homedir option. One stating "Adding home directory:" and the second one "Set home directory:".