-
Notifications
You must be signed in to change notification settings - Fork 109
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
Comments
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:
|
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
|
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.
... sometimes extremely cursed, and especially on Windows. Sorry about the bad experience. |
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 |
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? |
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! |
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 |
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:
Error log:
The text was updated successfully, but these errors were encountered: