Drewol / unnamed-sdvx-clone

A game based on K-Shoot MANIA and Sound Voltex
MIT License
776 stars 93 forks source link

C-Make ZLIB::ZLIB linking problems on Windows #256

Open Jirinrin opened 4 years ago

Jirinrin commented 4 years ago

On both of my Windows machines, I've always got this error when trying to run GenerateWin64ProjectFiles.bat:

image

I've always just fixed this by adding find_package(ZLIB REQUIRED) on line 17 on the rootCmakeLists.txt`, but surely something must be wrong on a deeper level? And I can't even find any problem with the CMakeLists linking... Does anyone else recognise this problem?

Hinara commented 4 years ago

Did you correctly use vcpkg install {dependencies} before ?

Jirinrin commented 4 years ago

Yeah, and note how it does work when I add an extra find_package(ZLIB REQUIRED) to the root CmakeLists.txt file

Hinara commented 4 years ago

So I think that FindLibraries.cmake might be not called ? as it as this line inside :/ Can you add a message("Something") inside to check if it is correctly called

ASleepyCat commented 4 years ago

I had the same problem and I fixed it by including "-DVCPKG_TARGET_TRIPLET=x64-windows-static" as a launch arg with CMake.

Jirinrin commented 4 years ago

Ah sorry Hinara, I forgot to reply ._. But the `-DVCPKG_TARGET_TRIPLET=x64-windows-static" actually works! Thankssss now I don't have to stash this edit to my CMakeLists.txt every time I switch branches :>

Any clue why this makes a difference? (And specifically for ZLIB) What's the default vcpkg target triplet?

ASleepyCat commented 4 years ago

I don't really know why specifying the triplet is only required for zlib. The default is x86-windows. You'd have to ask Drewol or someone more knowledgeable with vcpkg for the first question.

Hinara commented 4 years ago

Maybe zlib only accept to compile in static on your system ? -DVCPKG_TARGET_TRIPLET=x64-window might also work It's because as said before on some computers it might try to find 32bit librairies instead of 64bit