Compile failed on windows VS 2019

#1

Hi!

I try to compile VCMI by following the latest wiki page in Visual Studio 2019. Using this cmd:

cmake [VCMI_DIR]/source -DCMAKE_TOOLCHAIN_FILE=[VCMI_DIR]/vcpkg/scripts/buildsystems/vcpkg.cmake -G “Visual Studio 16 2019” -A x64

But my job fail in VCAI module. The error is:

1>------ Build started: Project: update_version, Configuration: Release x64 ------
1>-- -- -- Start of Git information
1>-- GIT_SHA1: 55b54024a82aaad3b4572d674d424c2247a47930
1>-- -- -- End of Git information
2>------ Build started: Project: VCAI, Configuration: Release x64 ------
2>VCMI_lib.lib(VCMI_lib.dll) : error LNK2005: "public: __cdecl std::vector<int,class std::allocator<int> >::~vector<int,class std::allocator<int> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in fuzzylite-static.lib(FldExporter.obj)
2>   Creating library E:/code/vcmi/windows_build/bin/Release/AI/VCAI.lib and object E:/code/vcmi/windows_build/bin/Release/AI/VCAI.exp
2>E:\code\vcmi\windows_build\bin\Release\AI\VCAI.dll : fatal error LNK1169: one or more multiply defined symbols found
2>Done building project "VCAI.vcxproj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

It seems some symbol in VCAI_lib.lib conflicts with fuzzylite-static.lib. Does anyone kown how to solve it? Thank you!

#2

I build using visual studio itself and cmake I used only to generate initial project. VS also triggers cmake during build.

#4

Both cmake cmdline (initial with vs2019) and vs2019 compile fail with this error. Initial with vs2017 and compile in vs2017 and cmake are both ok.

#5

I also have 2017 visual studio. Looks like better to stay with it.

#6

It seems support vs 2019 in building wiki. Maybe it should be deleted or add sometime more detail?