The International Simutrans Forum

 

Author Topic: _wfopen missing from mingw64  (Read 328 times)

0 Members and 1 Guest are viewing this topic.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9595
  • Languages: De,EN,JP
_wfopen missing from mingw64
« on: December 02, 2019, 02:28:03 PM »
Since my old computer broke, I had to resetup mingw64 for release. But now I cannot compile Simutrans any more. Hence, I cannot release the new version, since I fail to compile the exe by mingw64. In simsys.cc the function _wfopen is complained as missing by gcc. No combination of flag etc I tried could convince the compiler otherwise. But with it, no japanese supporting version can be built.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5564
  • Languages: EN, NO
Re: _wfopen missing from mingw64
« Reply #1 on: December 02, 2019, 04:44:29 PM »
Strange. My mingw64 has _wfopen. I updated it just a few days ago.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5564
  • Languages: EN, NO
Re: _wfopen missing from mingw64
« Reply #2 on: December 02, 2019, 08:34:34 PM »
I just tried to run a build (the first in a long time), and apart from a very long list of warnings due to lack of https://forum.simutrans.com/index.php/topic,19316.0.html, it compiles and runs fine. GCC 9.2.0 and mingw64 headers 8.0.0.

64-bit compilation doesn't work anymore with default C++ standard due to casting of pointers to longs, which are only 32-bit on Windows.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9595
  • Languages: De,EN,JP
Re: _wfopen missing from mingw64
« Reply #3 on: December 03, 2019, 01:13:32 AM »
Those casts are only one way. since these casts are used as hashes. That should work fine. Otherwise this would have crashed a very long time ago, since long is 32 bit on MSVC anyway.

Also those stupid warning are because older gcc had a bug which silently generated wrong code. Newer version, which do the right thing, instead emit this stupid warning. "Dno-deprecated-copy" removes this junk. (Also someone added "-Wextra" to the Makefile, so to have GCC extra verbose. Seeing this, I will not submit any GCC specific warning removal patches, if one does not want to see all that stuff, than one should not ask for it in the first place.)

Offline ceeac

  • *
  • Posts: 55
Re: _wfopen missing from mingw64
« Reply #4 on: December 03, 2019, 08:00:40 AM »
Also someone added "-Wextra" to the Makefile, so to have GCC extra verbose
According to the GCC documentation, -Wextra is just a more descriptive name for -W which has been in the code base since forever (>10 years).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9595
  • Languages: De,EN,JP
Re: _wfopen missing from mingw64
« Reply #5 on: December 03, 2019, 10:34:30 AM »
Ok, I found a discussion on a mailing list, that -Wextra gives more warnings. But as it may, for the problem in case silencing the warning may be the best option because it is rather not a problem in recent GCC or any other compiler.

And I could solve the problem: Aparently there was an old mingw-1.0 on drive D, which libraries were linked. Renaming that folder did solve my issue. So there will be a release tonight.
« Last Edit: December 03, 2019, 11:30:08 AM by prissi »