The International Simutrans Forum

 

Author Topic: How to compile Simutrans Extended with Visual Studio 2015  (Read 15495 times)

0 Members and 1 Guest are viewing this topic.

Offline ACarlotti

  • *
  • Posts: 483
Re: How to compile Simutrans Extended with Visual Studio 2015
« Reply #35 on: May 16, 2019, 12:01:28 AM »
That's an error in the code that wasn't previously spotted because most of us use multithreaded builds.

I was intending to make the thread await functions available in single threaded builds to allow a reduction the number of ifdefs needed elsewhere in the code, but failed to put the declarations outside the #ifdef MULTI_THREAD, and further failed to notice that the function definitions are inside a 600 line #ifdef MULTI_THREAD. There are two possible fixes to this - either put lines 4301 and 5581 inside #ifdefs, or put the function declarations and definitions outside ifdefs.

James: I've uploaded the latter solution to Github, but if you think the former fix would be better then we could probably do that instead.

Spenk009: You can wait for a fix upstream, but if you want to compile the code before then you can either switch to using a multithreaded build, or comment out the two lines that are causing errors.

EDIT: A thought on the merits of being able to call the await functions without #ifdefs - at the moments there is some inconstency about what condition is being tested - e.g. MULTI_THREAD_PATH_EXPLORER v.s. just MULTI_THREAD. If we can just call awaits whenever, then we don't need to worry about choosing between several valid conditions.

Offline Spenk009

  • *
  • Posts: 254
Re: How to compile Simutrans Extended with Visual Studio 2015
« Reply #36 on: May 16, 2019, 07:25:14 AM »
Please excuse my ignorance, but what parameter do I add to make a multithreaded build?

Offline ACarlotti

  • *
  • Posts: 483
Re: How to compile Simutrans Extended with Visual Studio 2015
« Reply #37 on: May 16, 2019, 03:00:24 PM »
The intended way to configure a build is to copy config.template to config.default, and then uncomment/edit the relevant lines. The template config file has MULTI_THREAD=1 set, so you wouldn't need to change that further unless you wanted to comment it out or set it to 0 (for a build without multithreading). You can also set BACKEND, COLOUR_DEPTH and OSTYPE here , so that you don't need to specify them each time on the command line (and doing so will probably make it less likely that you accidentally specify the wrong parameters on the command line, which could get your build into an inconsistent state).

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to compile Simutrans Extended with Visual Studio 2015
« Reply #38 on: May 18, 2019, 09:45:34 AM »
Splendid, thank you: fix incorporated.