Page 1 of 1

Visual Studio 2015 Community edition wont compile

Posted: 29 Oct 2016 13:36
by benem
Hi all

I'm trying to compile OpenTTD with Visual Studio 2015 Community edition update 3.

I've follow all the instructions. Get the latest source with svn, get the latest OpenTTD essentials and configure VS to point to it (include and library path).

But when I start to compile, I get a lot of error on fttypes.h system include file while compiling crashlog.cpp

The first (of over 280) is:

Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ..\src\crashlog.cpp) openttd C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\shared\fttypes.h 38

Basically it seems that LONGLONG is not defined when included fttypes.h

Undefining WITH_FREETYPE doesn't help.

Thank you for your help.

Re: Visual Studio 2015 Community edition wont compile

Posted: 29 Oct 2016 14:26
by benem
I've found the problem.

It seems that in the new windows SDK that come with VS 2915 Update 3 there is an incompatible fttypes.h include file.

The solution is to put the directory of OpenTTD essentials before the predefined include directories in VC++ Directories/Include Directories option.

Re: Visual Studio 2015 Community edition wont compile

Posted: 29 Oct 2016 14:54
by Alberth
Please note that in the wiki, so others can find it too

Re: Visual Studio 2015 Community edition wont compile

Posted: 05 Nov 2016 09:43
by coherently_olive
The information in the Wiki has been very helpful for me when compiling with Visual Studio 2015. Just a quick note: Step 2.1 says to close Visual Studio and install the Windows SDK, which did not work in my case. Instead, Visual Studio asked to download and install the Windows SDK automatically when I tried to open the solution file. This worked fine and the solution loaded correctly after restarting Visual Studio (I already had .NET Framework 4.6 installed before trying to load the solution file the first time).