Author Topic: Own compiled Simutrans not running (MinGW problem)  (Read 1339 times)

0 Members and 1 Guest are viewing this topic.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2504
  • Total likes: 261
  • Helpful: 88
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Own compiled Simutrans not running (MinGW problem)
« on: February 26, 2014, 09:10:02 PM »
I'm a little unsure of what's wrong, I have MinGW & MSYS installed, all libs compiled and working. I'm running 'make BACKEND=gdi OSTYPE=mingw COLOUR_DEPTH=16'. When I run the executable it crashes even before the window opens. The executable runs a child instance of itself. No modifications in the tree. I'm doing exactly what I did before I changed my HDD.

Executable download
« Last Edit: March 08, 2014, 01:16:30 AM by An_dz »

Offline TurfIt

Re: Own compiled Simutrans not running
« Reply #1 on: February 26, 2014, 10:12:58 PM »
Is this a relatively recent MinGW installation - Aug 2013 or later? I ran into a compiler bug last fall that had me try updating my MinGW installation, and that was disastrous. IIRC the code wouldn't even compile, so atleast you are past that. Also IIRC it would crash immediately on startup when using the __argv/c. Changing to _argv/c worked, but MSVC hated that or something. In the end I managed to stick with my older installation using w32api3.x (it was w32api4.x that broke everything I think) and just updated the compiler.

I think Ters had done some further investigation, but I don't think any of the required changes made it into the Simutrans code. So I think the current state is if you want to use MinGW, you need an older installation.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2504
  • Total likes: 261
  • Helpful: 88
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Own compiled Simutrans not running
« Reply #2 on: February 26, 2014, 11:33:53 PM »
I'm using an old version of MinGW, I had the same problem before when I tried using an updated version.

I was using w32api4.x and tried downgrading to 3.x but to no avail. I'll try using everything from 2012.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2504
  • Total likes: 261
  • Helpful: 88
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Own compiled Simutrans not running
« Reply #3 on: February 27, 2014, 12:58:51 AM »
Yeah, older version worked, thanks for the light of w32api 3.x. Now I'm using:
gcc 4.6.2
w32api 3.17
make 3.82
msys 1.0.17

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4502
  • Total likes: 151
  • Helpful: 105
  • Languages: EN, NO
Re: Own compiled Simutrans not running
« Reply #4 on: February 27, 2014, 06:45:43 AM »
I think Ters had done some further investigation, but I don't think any of the required changes made it into the Simutrans code. So I think the current state is if you want to use MinGW, you need an older installation.

The only solutions are: to not use mingw32's w32api 4.x, or to add some #ifdefs so that one underscore is used with mingw32, and two for everything else. mingw64 is supposed to have more up-to-date header files, and may also not have broken __argc and __argv, but it wasn't so easy to actually find a binary release of mingw64. In fact, the one I found was from another separate project, although one dedicated to making a mingw64 installer. I haven't tried building Simutrans with it yet (mingw64 can also build 32-bit executable, although that appears to require two serarate installations at the moment), but the header is very different when it comes to __argc and __argv.