Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when installing via HunterGate #138

Closed
Caleb-T-Owens opened this issue May 28, 2022 · 7 comments
Closed

Error when installing via HunterGate #138

Caleb-T-Owens opened this issue May 28, 2022 · 7 comments

Comments

@Caleb-T-Owens
Copy link

Hi!

I'm trying to use HunterGate to install magnum but getting a compiler error for corrade.

I've got the desktop development package bundle installed for Visual Studio 17.2.2

cmake file:

cmake_minimum_required(VERSION 3.22)
include("cmake/HunterGate.cmake")

HunterGate(
        URL "https://github.com/cpp-pm/hunter/archive/v0.24.2.tar.gz"
        SHA1 "17fd3b9f0b8c271eac9b71e30a6aa1b9fecab299"
)

project(untitled)

# set(CMAKE_PREFIX_PATH ${PROJECT_SOURCE_DIR}/SDL2-2.0.10 ${CMAKE_PREFIX_PATH})
hunter_add_package(magnum)
find_package(Magnum REQUIRED)

set(CMAKE_CXX_STANDARD 20)

add_executable(main main.cpp)

Error log:

"C:\Program Files\JetBrains\CLion 2022.1.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=C:/Program Files/JetBrains/CLion 2022.1.1/bin/ninja/win/ninja.exe" -G Ninja -S C:\Users\cocac\CLionProjects\untitled -B C:\Users\cocac\CLionProjects\untitled\cmake-build-debug
-- [hunter] Calculating Toolchain-SHA1
-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: C:/.hunter
-- [hunter] [ Hunter-ID: 17fd3b9 | Toolchain-ID: 5ae49be | Config-ID: 12daff0 ]
-- [hunter] MAGNUM_ROOT: C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Install (ver.: 2019.01)
-- [hunter] Building magnum
loading initial cache file C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/cache.cmake
loading initial cache file C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/args.cmake
-- The C compiler identification is MSVC 19.32.31329.0
-- The CXX compiler identification is MSVC 19.32.31329.0
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx86/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/Build
[1/16] Creating directories for 'magnum-Release'
[1/16] Performing download step (download, verify and extract) for 'magnum-Release'
-- verifying file...
       file='C:/.hunter/_Base/Download/magnum/2019.01/af356ad/v2019.01.tar.gz'
-- File already exists and hash match (skip download):
  file='C:/.hunter/_Base/Download/magnum/2019.01/af356ad/v2019.01.tar.gz'
  SHA1='af356adc9e83826d55bd7f438c29f98104f95fd0'
-- extracting...
     src='C:/.hunter/_Base/Download/magnum/2019.01/af356ad/v2019.01.tar.gz'
     dst='C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/Source'
-- extracting... [tar xfz]
cmake -E tar: warning: skipping symbolic link "magnum-2019.01/.travis.yml" -> "package/ci/travis.yml".
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[2/16] No update step for 'magnum-Release'
[4/16] No patch step for 'magnum-Release'
[4/16] Performing configure step for 'magnum-Release'
loading initial cache file C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/cache.cmake
loading initial cache file C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/args.cmake
-- The CXX compiler identification is MSVC 19.32.31329.0
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [hunter] HUNTER_ROOT: C:/.hunter
-- [hunter] [ Hunter-ID: 17fd3b9 | Toolchain-ID: 5ae49be | Config-ID: 12daff0 ]
-- [hunter] CORRADE_ROOT: C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Install (ver.: 2019.10)
-- [hunter] Building corrade
loading initial cache file C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/cache.cmake
loading initial cache file C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade/args.cmake
-- The C compiler identification is MSVC 19.32.31329.0
-- The CXX compiler identification is MSVC 19.32.31329.0
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx86/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade/Build
[1/16] Creating directories for 'corrade-Release'
[1/16] Performing download step (download, verify and extract) for 'corrade-Release'
-- verifying file...
       file='C:/.hunter/_Base/Download/corrade/2019.10/e3cf4cb/v2019.10.tar.gz'
-- File already exists and hash match (skip download):
  file='C:/.hunter/_Base/Download/corrade/2019.10/e3cf4cb/v2019.10.tar.gz'
  SHA1='e3cf4cbf5994a31140c236317b6547b8115a91e8'
-- extracting...
     src='C:/.hunter/_Base/Download/corrade/2019.10/e3cf4cb/v2019.10.tar.gz'
     dst='C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade/Source'
-- extracting... [tar xfz]
cmake -E tar: warning: skipping symbolic link "corrade-2019.10/.travis.yml" -> "package/ci/travis.yml".
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[2/16] No update step for 'corrade-Release'
[4/16] No patch step for 'corrade-Release'
[4/16] Performing configure step for 'corrade-Release'
loading initial cache file C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/cache.cmake
loading initial cache file C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade/args.cmake
-- The CXX compiler identification is MSVC 19.32.31329.0
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- LIB_SUFFIX variable is not defined. It will be autodetected now.
-- You can set it manually with -DLIB_SUFFIX=<value> (64 for example)
-- LIB_SUFFIX autodetected as '', libraries will be installed into C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade/Install/lib
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include stddef.h
-- Looking for C++ include stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Configuring done
-- Generating done
-- Build files have been written to: C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade/Build/corrade-Release-prefix/src/corrade-Release-build
[5/16] Performing build step for 'corrade-Release'
[1/46] Building CXX object src\Corrade\Interconnect\CMakeFiles\CorradeInterconnect.dir\Connection.cpp.obj
[2/46] Building CXX object src\Corrade\PluginManager\CMakeFiles\CorradePluginManagerObjects.dir\AbstractPlugin.cpp.obj
[3/46] Building CXX object src\Corrade\CMakeFiles\CorradeMain.dir\CorradeMain.cpp.obj
[4/46] Building CXX object src\Corrade\Interconnect\CMakeFiles\CorradeInterconnect.dir\Receiver.cpp.obj
[5/46] Building CXX object src\Corrade\PluginManager\CMakeFiles\CorradePluginManagerObjects.dir\PluginMetadata.cpp.obj
[6/46] Building CXX object src\Corrade\TestSuite\CMakeFiles\CorradeTestSuite.dir\Compare\File.cpp.obj
[7/46] Linking CXX static library Release\lib\CorradeMain.lib
[8/46] Building CXX object src\Corrade\Interconnect\CMakeFiles\CorradeInterconnect.dir\Emitter.cpp.obj
[9/46] Building CXX object src\Corrade\TestSuite\CMakeFiles\CorradeTestSuite.dir\Comparator.cpp.obj
[10/46] Building CXX object src\Corrade\TestSuite\CMakeFiles\CorradeTestSuite.dir\Compare\FloatingPoint.cpp.obj
[11/46] Building CXX object src\Corrade\TestSuite\CMakeFiles\CorradeTestSuite.dir\Compare\StringToFile.cpp.obj
[12/46] Building CXX object src\Corrade\TestSuite\CMakeFiles\CorradeTestSuite.dir\Compare\FileToString.cpp.obj
[13/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\MurmurHash2.cpp.obj
[14/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\Sha1.cpp.obj
[15/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\ConfigurationValue.cpp.obj
[16/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\Debug.cpp.obj
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\Debug.cpp(408) : warning C4722: 'Corrade::Utility::Fatal::~Fatal': destructor never returns, potential memory leak
[17/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\Configuration.cpp.obj
[18/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\TweakableParser.cpp.obj
[19/46] Building CXX object src\Corrade\PluginManager\CMakeFiles\CorradePluginManager.dir\AbstractManager.cpp.obj
[20/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\System.cpp.obj
[21/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\FileWatcher.cpp.obj
[22/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtility.dir\Format.cpp.obj
FAILED: src/Corrade/Utility/CMakeFiles/CorradeUtility.dir/Format.cpp.obj 
C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1432~1.313\bin\Hostx86\x86\cl.exe  /nologo /TP -DCorradeUtility_EXPORTS -DNOMINMAX -DUNICODE -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -IC:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src -IC:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Build\corrade-Release-prefix\src\corrade-Release-build\src /DWIN32 /D_WINDOWS  /GR /EHsc /MD /O2 /Ob2 /DNDEBUG /W4 /wd4251 /wd4244 /wd4267 /wd4351 /wd4373 /wd4510 /wd4610 /wd4512 /wd4661 /wd4702 /wd4706 /wd4800 /wd4910 /showIncludes /Fosrc\Corrade\Utility\CMakeFiles\CorradeUtility.dir\Format.cpp.obj /Fdsrc\Corrade\Utility\CMakeFiles\CorradeUtility.dir\ /FS -c C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\Format.cpp
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\Format.cpp(395): error C2666: '+': 2 overloads have similar conversions
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\Format.cpp(395): note: could be 'built-in C++ operator+(bool, size_t)'
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\Format.cpp(395): note: or       'built-in C++ operator+(T, int)'
        with
        [
            T=char
        ]
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\Format.cpp(395): note: while trying to match the argument list '(const Corrade::Containers::ArrayView<char>, size_t)'
[23/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\Directory.cpp.obj
[24/46] Building CXX object src\Corrade\Utility\CMakeFiles\corrade-rc.dir\String.cpp.obj
FAILED: src/Corrade/Utility/CMakeFiles/corrade-rc.dir/String.cpp.obj 
C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1432~1.313\bin\Hostx86\x86\cl.exe  /nologo /TP -DCORRADE_BUILD_STATIC -DNOMINMAX -DUNICODE -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -IC:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src -IC:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Build\corrade-Release-prefix\src\corrade-Release-build\src /DWIN32 /D_WINDOWS  /GR /EHsc /MD /O2 /Ob2 /DNDEBUG /W4 /wd4251 /wd4244 /wd4267 /wd4351 /wd4373 /wd4510 /wd4610 /wd4512 /wd4661 /wd4702 /wd4706 /wd4800 /wd4910 /showIncludes /Fosrc\Corrade\Utility\CMakeFiles\corrade-rc.dir\String.cpp.obj /Fdsrc\Corrade\Utility\CMakeFiles\corrade-rc.dir\ /FS -c C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\String.cpp
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\String.cpp(132): error C2666: '+': 2 overloads have similar conversions
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\String.cpp(132): note: could be 'built-in C++ operator+(bool, size_t)'
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\String.cpp(132): note: or       'built-in C++ operator+(const T, int)'
        with
        [
            T=const char
        ]
C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Source\src\Corrade\Utility\String.cpp(132): note: while trying to match the argument list '(Corrade::Containers::ArrayView<const char>, size_t)'
[25/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtility.dir\ConfigurationGroup.cpp.obj
[26/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtilityObjects.dir\Tweakable.cpp.obj
[27/46] Building CXX object src\Corrade\Utility\CMakeFiles\corrade-rc.dir\rc.cpp.obj
[28/46] Building CXX object src\Corrade\TestSuite\CMakeFiles\CorradeTestSuite.dir\Tester.cpp.obj
[29/46] Building CXX object src\Corrade\Utility\CMakeFiles\CorradeUtility.dir\Arguments.cpp.obj
ninja: build stopped: subcommand failed.
FAILED: corrade-Release-prefix/src/corrade-Release-stamp/corrade-Release-build C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade/Build/corrade-Release-prefix/src/corrade-Release-stamp/corrade-Release-build 
cmd.exe /C "cd /D C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\corrade\Build\corrade-Release-prefix\src\corrade-Release-build && "C:\Program Files\JetBrains\CLion 2022.1.1\bin\cmake\win\bin\cmake.exe" --build . --config Release -- -j8 && "C:\Program Files\JetBrains\CLion 2022.1.1\bin\cmake\win\bin\cmake.exe" -E touch C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade/Build/corrade-Release-prefix/src/corrade-Release-stamp/corrade-Release-build"
ninja: build stopped: subcommand failed.

[hunter ** FATAL ERROR **] Build step failed (dir: C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/corrade
[hunter ** FATAL ERROR **] [Directory:C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/projects/corrade]

------------------------------ ERROR -----------------------------
    https://hunter.readthedocs.io/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------

CMake Error at C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/modules/hunter_download.cmake:623 (hunter_fatal_error)
  C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/projects/corrade/hunter.cmake:72 (hunter_download)
  C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
  package/hunter/HunterAddPackages.cmake:27 (hunter_add_package)
  CMakeLists.txt:43 (include)


-- Configuring incomplete, errors occurred!
See also "C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/Build/magnum-Release-prefix/src/magnum-Release-build/CMakeFiles/CMakeOutput.log".
FAILED: magnum-Release-prefix/src/magnum-Release-stamp/magnum-Release-configure C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/Build/magnum-Release-prefix/src/magnum-Release-stamp/magnum-Release-configure 
cmd.exe /C "cd /D C:\.hunter\_Base\17fd3b9\5ae49be\12daff0\Build\magnum\Build\magnum-Release-prefix\src\magnum-Release-build && "C:\Program Files\JetBrains\CLion 2022.1.1\bin\cmake\win\bin\cmake.exe" -GNinja -CC:/.hunter/_Base/17fd3b9/5ae49be/12daff0/cache.cmake -CC:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/args.cmake -DCMAKE_RELEASE_POSTFIX= -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/Install -DCMAKE_TOOLCHAIN_FILE=C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:/PROGRA~1/JETBRA~1/CLION2~1.1/bin/ninja/win/ninja.exe -GNinja C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/Source && "C:\Program Files\JetBrains\CLion 2022.1.1\bin\cmake\win\bin\cmake.exe" -E touch C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum/Build/magnum-Release-prefix/src/magnum-Release-stamp/magnum-Release-configure"
ninja: build stopped: subcommand failed.

[hunter ** FATAL ERROR **] Build step failed (dir: C:/.hunter/_Base/17fd3b9/5ae49be/12daff0/Build/magnum
[hunter ** FATAL ERROR **] [Directory:C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/projects/magnum]

------------------------------ ERROR -----------------------------
    https://hunter.readthedocs.io/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------

CMake Error at C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/modules/hunter_download.cmake:623 (hunter_fatal_error)
  C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/projects/magnum/hunter.cmake:116 (hunter_download)
  C:/.hunter/_Base/Download/Hunter/0.24.2/17fd3b9/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
  CMakeLists.txt:12 (hunter_add_package)


-- Configuring incomplete, errors occurred!
See also "C:/Users/cocac/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeOutput.log".

[Failed to reload]
@mosra
Copy link
Owner

mosra commented May 28, 2022

Hello! :)

Oh, haha, version 2019.10, seems like Hunter packages didn't get updated in quite a while. This is an error that happens on MSVC 2022, and is fixed since 00cfbbb (Feb 2022). Unfortunately no release was tagged since (it's tracked in mosra/magnum#453), so even if Hunter was on latest stable release, it wouldn't help.

You have these options:

  • Use latest master via some other package manager such as vcpkg, by building manually, or by using a CMake subproject. I recommend this option because there's just a lot that happened since.
  • Or, if you can't, pass /permissive- to CMAKE_CXX_FLAGS. I hope Hunter can pick it up, somehow. That makes this particular error go away, and hopefully could be also enough to make Magnum build. But I can't say for sure, there might be other things that make the old 2019.10 release broken with MSVC 2022.

@Caleb-T-Owens
Copy link
Author

So, I was trying to use vcpkg and it was failing at compiling corrade too. C++ tooling is something I struggle with so I could be doing it wrong

PS C:\Users\cocac\CLionProjects\untitled> ./vcpkg/vcpkg install magnum:x64-windows
Computing installation plan...
The following packages will be built and installed:
  * corrade[core,interconnect,pluginmanager,testsuite,utility]:x64-windows -> 2020.06#4
    magnum[anyaudioimporter,anyimageconverter,anyimageimporter,anysceneconverter,anysceneimporter,anyshaderconverter,audio,core,debugtools,gl,meshtools,primitives,sc
enegraph,sdl2application,shaders,shadertools,text,texturetools,trade]:x64-windows -> 2020.06#9
  * openal-soft[core]:x64-windows -> 1.21.1#5
  * sdl2[core]:x64-windows -> 2.0.22
  * vcpkg-cmake[core]:x64-windows -> 2022-05-10
  * vcpkg-cmake-config[core]:x64-windows -> 2022-02-06
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Restored 0 packages from C:\Users\cocac\AppData\Local\vcpkg\archives in 712.6 us. Use --debug to see more details.
Installing 1/6 corrade:x64-windows...
Building corrade[core,interconnect,pluginmanager,testsuite,utility]:x64-windows...
-- Using cached mosra-corrade-v2020.06.tar.gz.
-- Cleaning sources at C:/Users/cocac/CLionProjects/untitled/vcpkg/buildtrees/corrade/src/v2020.06-a168426893.clean. Use --editable to skip cleaning for the packages
 you specify.
-- Extracting source C:/Users/cocac/CLionProjects/untitled/vcpkg/downloads/mosra-corrade-v2020.06.tar.gz
-- Applying patch fix-vs2019.patch
-- Applying patch build-corrade-rc-always.patch
-- Using source at C:/Users/cocac/CLionProjects/untitled/vcpkg/buildtrees/corrade/src/v2020.06-a168426893.clean
-- Found external ninja('1.10.2').
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
CMake Error at scripts/cmake/vcpkg_copy_tool_dependencies.cmake:52 (message):
  Could not find PowerShell Core; please open an issue to report this.
Call Stack (most recent call first):
  scripts/cmake/vcpkg_copy_tools.cmake:82 (vcpkg_copy_tool_dependencies)
  ports/corrade/portfile.cmake:56 (vcpkg_copy_tools)
  scripts/ports.cmake:146 (include)

error: building corrade:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+corrade
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[corrade]+Build+error
Include '[corrade] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
    vcpkg-tool version: 2022-05-05-67e17c1782801cf481be9ac0b3765dff3e4bdeb8
    vcpkg-scripts version: d953973cf 2022-05-27 (22 hours ago)

@mosra
Copy link
Owner

mosra commented May 28, 2022

CMake Error at scripts/cmake/vcpkg_copy_tool_dependencies.cmake:52 (message):
  Could not find PowerShell Core; please open an issue to report this.

Seems like Vcpkg itself is broken 😅 I don't know what to suggest here, except for directing this to Vcpkg developers. Or maybe there's some shortcut, like installing PowerShell Core? But why wouldn't it be on Windows by default? I'm not on Windows, so I can only guess.

C++ tooling is

... sometimes extremely cursed, and especially on Windows. Sorry about the bad experience.

@Caleb-T-Owens
Copy link
Author

Seems to be installing now with vcpkg using my powershell 7 install and not the default shell in CLion. I hadn't spotted that part of the error message 🤦. So windows comes with PowerShell 5, before it was made into the new multiplatform powershell 7 and powershell core so I guess because CLion defaults to PWSH 5 it couldn't find the correct pwsh core

@Caleb-T-Owens
Copy link
Author

Sorry to be a hassle, in the magnum docs it says "Packages installed using Vcpkg can be used in Visual Studio straight away — all you need to do is to #include the headers you want and the buildsystem will do all needed library linking and setup behind the scenes automatically. (Cool, isn't it?)".

As a non visual studio user, what should the correct target_include_directories be?

@Caleb-T-Owens
Copy link
Author

Caleb-T-Owens commented May 29, 2022

Ahhh YEY! Got it.

For others, my working cmake config is:

cmake_minimum_required(VERSION 3.22)

project(untitled)

find_package(Magnum REQUIRED GL Sdl2Application)

set(CMAKE_CXX_STANDARD 20)

add_executable(main main.cpp)

target_include_directories(main PRIVATE ${Magnum_INCLUDE_DIRS})

target_link_libraries(main PRIVATE
        Magnum::Application
        Magnum::GL
        Magnum::Magnum)

with the sample code of

#include <Magnum/GL/DefaultFramebuffer.h>
#include <Magnum/Platform/Sdl2Application.h>

using namespace Magnum;

class MyApplication: public Platform::Application {
public:
    explicit MyApplication(const Arguments& arguments);

private:
    void drawEvent() override;
};

MyApplication::MyApplication(const Arguments& arguments):
        Platform::Application{arguments}
{
    // TODO: Add your initialization code here
}

void MyApplication::drawEvent() {
    GL::defaultFramebuffer.clear(GL::FramebufferClear::Color);

    // TODO: Add your drawing code here

    swapBuffers();
}

MAGNUM_APPLICATION_MAIN(MyApplication)

thanks @mosra for the help!

@mosra
Copy link
Owner

mosra commented May 29, 2022

Yay! 🎉 Just to answer what you were asking above -- the

target_include_directories(main PRIVATE ${Magnum_INCLUDE_DIRS})

bit shouldn't be needed, at all. Just target_link_libraries(). The Magnum::Foo CMake imported targets take care of all that -- supplying include directories, compiler/linker flags (if needed), and linking the right libraries in the right order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants