MegaGlest Forum

Archives (read only) => Vanilla Glest => Bug report => Topic started by: daniel.santos on 22 February 2008, 04:44:33

Title: r125 crashes on linux
Post by: daniel.santos on 22 February 2008, 04:44:33
a segfault is created very shortly after startup.  This is caused because the new command line code removes some SDL initialization that is needed (formerly in shared_lib/include/platform/sdl/platform_main.h).  I hacked mine to get it running on Linux temporarily:
Code: [Select]
int main(int argc, char** argv){
if (SDL_Init(SDL_INIT_EVERYTHING) < 0)  {
std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n";
return 1;
}

SDL_EnableUNICODE(1);

int result = Glest::Game::glestMain(argc, argv);
SDL_Quit();
return result;
}


Maybe we can stick the platform_main.h's back in and just modify them to pass on the argc and argv.
Title:
Post by: martiño on 22 February 2008, 10:34:27
I will fix it ASAP.
Title:
Post by: martiño on 22 February 2008, 19:02:12
Should be fixed now.
Title:
Post by: daniel.santos on 23 February 2008, 03:51:50
Thank you Martiño.  Mine is working because I have glest_game/main.cpp modified, but this may still be broken in subversion since the new main function doesn't call the macro.  So it should compile on windows still, but will still crash in Linux since it's not using the MAIN_FUNCTION macro:
Code: [Select]
int main(int argc, char** argv){
    return Glest::Game::glestMain(argc, argv);
}
instead of:
Code: [Select]
MAIN_FUNCTION(Glest::Game::glestMain)
Thanks again.
Title:
Post by: martiño on 23 February 2008, 14:08:35
I forgot to check main.cpp in, it is done now.