Author Topic: r125 crashes on linux  (Read 2446 times)

daniel.santos

  • Guest
r125 crashes on linux
« 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.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

martiño

  • Behemoth
  • *******
  • Posts: 1,095
    • View Profile
(No subject)
« Reply #1 on: 22 February 2008, 10:34:27 »
I will fix it ASAP.
« Last Edit: 1 January 1970, 00:00:00 by martiño »

martiño

  • Behemoth
  • *******
  • Posts: 1,095
    • View Profile
(No subject)
« Reply #2 on: 22 February 2008, 19:02:12 »
Should be fixed now.
« Last Edit: 1 January 1970, 00:00:00 by martiño »

daniel.santos

  • Guest
(No subject)
« Reply #3 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.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

martiño

  • Behemoth
  • *******
  • Posts: 1,095
    • View Profile
(No subject)
« Reply #4 on: 23 February 2008, 14:08:35 »
I forgot to check main.cpp in, it is done now.
« Last Edit: 1 January 1970, 00:00:00 by martiño »

 

anything