Coder Social home page Coder Social logo

Comments (7)

Caleb-T-Owens avatar Caleb-T-Owens commented on May 23, 2024 1

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

from corrade.

mosra avatar mosra commented on May 23, 2024

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.

from corrade.

Caleb-T-Owens avatar Caleb-T-Owens commented on May 23, 2024

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)

from corrade.

mosra avatar mosra commented on May 23, 2024
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.

from corrade.

Caleb-T-Owens avatar Caleb-T-Owens commented on May 23, 2024

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?

from corrade.

Caleb-T-Owens avatar Caleb-T-Owens commented on May 23, 2024

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!

from corrade.

mosra avatar mosra commented on May 23, 2024

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.

from corrade.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.