Errors building using VS 2015

I went ahead and followed instructions from … I_(Windows using Microsoft Visual Studio 2015 Community even though it says to use “Microsoft Visual C++ 2013 Express for Desktop”. If VS 2015 isn’t supported, then I guess there’s no more to be said.

If other people are able to build using VS 2015, then I think my directory structure isn’t right. Here’s my base vcmi folder:


Where bin, include, lib, and share are all from “vcmi_bundle.7z” file on the “how to build vcmi” link referenced above. Trunk is a fork of the vcmi github repo.

In addition, I installed boost 1.62 to the default location, C:\local\boost_1_62_0. As per the “put along with other libs” instructions (I wasn’t able to figure out how to apply “global” configuration settings in VS 2015, and also tried “individually per project” with the same compilation errors), I copied the “boost” directory to vcmi/include and the *.lib (~340 files) from lib32-msvc-14.0 to vcmi/lib.

After doing this, I run “build solution” (loading the “VCMI_VS11.sln” file) and get 27 errors, mostly some variant of the two below

-“Cannot open include file: ‘unistd.h/SDL_version.h/’: No such file or directory”
-“Cannot open input file 'VCMI_lib.lib”

And, of course, no new vcmi binaries in the /vcmi/trunk directory. If you’d like, I can attach output and/or give more information. Thanks!

Finally got it to build after doing these steps:

-I cleared up most errors by dumping all my sdl/ffmpeg/etc header files straight into /vcmi/include instead of a directory like /vcmi/include/SDL2.

-In addition, the bundle on the wiki does not work so I reinstalled all the libraries separately.

-I also had trouble getting zlib1.dll to work, so I had to download the older version of zlib (zlib 1.1.4) which yielded zlib.dll instead of zlib1.dll. In addition, there was a weird bug where I had to add “#define ZLIB_WINAPI” before ‘#include “zlib.h”’ (see … tudio-2012) to certain files.

-I created a separate ‘libs’ folder in trunk (/vcmi/trunk) that has “zlib.lib” in it because the “minizip” project doesn’t search the usual (/vcmi/libs) folder. Also just remembered, I had to rename “lib” to “libs” in /vcmi directory. Hope this helps someone!

And yes, the Wiki bundle might be outdated. No one else maintains it and in fact I didn’t update that page for ages.

“Lib” and 'libs" are two separate folders. One holds VCMI_LIB project, the other holds .dll files linked by VCMI.

Either way, I’m glad that you made it. :wink: