0

I'm trying to build this on Visual Studio 2013. I set the include and library paths for ZLIB and TINYXML2 and generated the projects using cmake. When I try to build it, I get these errors:

1>------ Build started: Project: tmxparser, Configuration: Debug Win32 ------
2>------ Build started: Project: tmxparser_static, Configuration: Debug Win32 ------
1>cl : Command line error D8021: invalid numeric argument '/Werror=strict-prototypes'
2>cl : Command line error D8021: invalid numeric argument '/Werror=strict-prototypes'
3>cl : Command line error D8021: invalid numeric argument '/Werror'
5>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
5>Project not selected to build for this solution configuration 
========== Build: 1 succeeded, 3 failed, 1 up-to-date, 1 skipped ==========
MysticSheik
  • 53
  • 1
  • 8
  • `/Werror=strict-prototypes` is a GCC/Clang warning and isn't recognised by Visual Studio. You'll need to remove it from your CMakeLists.txt. However, if it's [this TMXParser](https://github.com/andrewrk/tmxparser) you're using, the docs state: "Drop support for Android and Windows. If you want a Windows build, use mxe." – Fraser Aug 25 '15 at 07:13
  • I don't know - I've never heard of it :) There's some docs in the wiki though which may help (https://github.com/mxe/mxe/wiki) but I don't see either a CMakeLists.txt or a Visual Studio .sln file, so I guess you can't build it with Visual Studio. Maybe you'll need MinGW installed to build this? – Fraser Aug 25 '15 at 08:50
  • MXE is a cross-compiling environment that runs on Unix systems like Linux, which does builds for Windows based on MinGW. So I guess in referring you there, andrewrk expects you to develop on Linux and compile your Windows builds from there as well. You could open an issue on the issue tracker to ask about support for compiling _on_ Windows. – Thorbjørn Lindeijer Aug 25 '15 at 10:53
  • Thanks for the help! – MysticSheik Aug 25 '15 at 12:22

1 Answers1

0

You need to change something in file CMakeList.txt.

set(LIB_CFLAGS "${LIB_CFLAGS} -std=c++11")

if (NOT USE_MINIZ)
    list(APPEND ${LIB_CFLAGS})
endif (NOT USE_MINIZ)

set(EXAMPLE_CFLAGS "${EXAMPLE_CFLAGS} -std=c++11")

I built it succesfully. You can download it at this link.

Usage:

In Visual Studio, you have to add zlibd.lib into

Project properties->Linker->input
Roberto Caboni
  • 7,252
  • 10
  • 25
  • 39