Comments (20)
You need to:
- if you haven't done already, install ImGuiIntegration via
vcpkg install magnum-integration[imgui]
- add
FindImGui.cmake
andFindMagnumIntegration.cmake
from here to themodules/
directory in your project - then reconfigure the project via CMake, it should pick up everything correctly
from magnum-plugins.
Step by step ouhhhhh babbbbyyyy gonna get to you gurrrllllll https://www.youtube.com/watch?v=ay6GjmiJTPM:
- Install integration:
vcpkg install magnum-integration[imgui]
The following packages will be built and installed:
* imgui[core]:x86-windows
magnum-integration[core,imgui]:x86-windows
Additional packages (*) will be modified to complete this operation.
Starting package 1/2: imgui:x86-windows
Building package imgui[core]:x86-windows...
CMake Warning at ports/imgui/portfile.cmake:4 (message):
The author of imgui strongly advises users of this lib against using a DLL.
For more details, please visit:
https://github.com/Microsoft/vcpkg/issues/5110
Call Stack (most recent call first):
scripts/ports.cmake:71 (include)
-- Downloading https://github.com/ocornut/imgui/archive/v1.68.tar.gz...
-- Extracting source G:/programming/c++/vcpkg/downloads/ocornut-imgui-v1.68.tar.gz
-- Using source at G:/programming/c++/vcpkg/buildtrees/imgui/src/v1.68-35b2ef549f
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Performing post-build validation
-- Performing post-build validation done
Building package imgui[core]:x86-windows... done
Installing package imgui[core]:x86-windows...
Installing package imgui[core]:x86-windows... done
Elapsed time for package imgui:x86-windows: 23.66 s
Starting package 2/2: magnum-integration:x86-windows
Building package magnum-integration[core,imgui]:x86-windows...
-- Downloading https://github.com/mosra/magnum-integration/archive/v2019.01.tar.gz...
-- Extracting source G:/programming/c++/vcpkg/downloads/mosra-magnum-integration-v2019.01.tar.gz
-- Using source at G:/programming/c++/vcpkg/buildtrees/magnum-integration/src/v2019.01-a206003452
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Performing post-build validation
-- Performing post-build validation done
Building package magnum-integration[core,imgui]:x86-windows... done
Installing package magnum-integration[core,imgui]:x86-windows...
Installing package magnum-integration[core,imgui]:x86-windows... done
Elapsed time for package magnum-integration:x86-windows: 19.19 s
Total elapsed time: 42.84 s
The package magnum-integration:x86-windows provides CMake targets:
find_package(MagnumIntegration CONFIG REQUIRED)
target_link_libraries(main PRIVATE MagnumIntegration::${_component})
- Added both files into my root modules folder.
- CMakeList.txt of my project:
find_package(Magnum REQUIRED GL Shaders Sdl2Application)
find_package(MagnumIntegration REQUIRED ImGui)
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
add_executable(Multiverses Multiverses.cpp)
target_link_libraries(Multiverses PRIVATE
Magnum::Application
Magnum::GL
Magnum::Magnum
Magnum::Shaders
MagnumIntegration::ImGui)
- Rebuild all and only one error
from magnum-plugins.
Hmm. Weird, shouldn't happen. Did you reconfigure/regenerate CMake before hitting rebuild?
from magnum-plugins.
Visual Studio popped a dialog which asked me to reload all.
I've checked the additional dependencies:
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\MagnumSdl2Application-d.lib
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\MagnumGL-d.lib
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\Magnum-d.lib
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\MagnumShaders-d.lib
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\MagnumImGuiIntegration-d.lib
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\SDL2d.lib
opengl32.lib
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\CorradeUtility-d.lib
ImGui::ImGui.lib
from magnum-plugins.
Yeah well that's wrong. You need to hit Configure/Generate from the CMake GUI. Please post here what the log says.
from magnum-plugins.
Yeah well that's wrong. You need to hit Configure/Generate from the CMake GUI. Please post here what the log says.
from magnum-plugins.
🤔 right, yes that explains the linker error. Since this didn't happen for anybody before I optimistically assume this is just some internal CMake state getting confused (yes, this happens sometimes, CMake is a complex beast). Can you delete the build directory generated by CMake and do the CMake configuration again from scratch?
from magnum-plugins.
🤔 right, yes that explains the linker error. Since this didn't happen for anybody before I optimistically assume this is just some internal CMake state getting confused (yes, this happens sometimes, CMake is a complex beast). Can you delete the build directory generated by CMake and do the CMake configuration again from scratch?
from magnum-plugins.
Looks like you forgot to point CMAKE_TOOLCHAIN_FILE
to the vcpkg toolchain file in the initial run.
from magnum-plugins.
I added the entry in the UI and still error:
I tried to launch CMake from the command line instead:
PS G:\programming\c++\multiverses\build> cmake .. -DCMAKE_TOOLCHAIN_FILE=G:\programming\c++\vcpkg\scripts\buildsystems/vcpkg.cmake
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.16.27027.1
-- The CXX compiler identification is MSVC 19.16.27027.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Corrade: G:/programming/c++/vcpkg/installed/x86-windows/include found components: Containers rc Utility
-- Found OpenGL: opengl32
-- Found SDL2: optimized;G:/programming/c++/vcpkg/installed/x86-windows/lib/SDL2.lib;debug;G:/programming/c++/vcpkg/installed/x86-windows/debug/lib/SDL2d.lib
-- Found Magnum: G:/programming/c++/vcpkg/installed/x86-windows/include found components: GL Shaders Sdl2Application
-- 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:/Program Files (x86)/Multiverses/lib
-- Found Magnum: G:/programming/c++/vcpkg/installed/x86-windows/include found components: GL
-- Found MagnumIntegration: G:/programming/c++/vcpkg/installed/x86-windows/include found components: ImGui
-- Configuring done
CMake Error at G:/programming/c++/vcpkg/scripts/buildsystems/vcpkg.cmake:148 (_add_executable):
Target "Multiverses" links to target "ImGui::ImGui" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
src/CMakeLists.txt:6 (add_executable)
CMake Error at G:/programming/c++/vcpkg/scripts/buildsystems/vcpkg.cmake:148 (_add_executable):
Target "Multiverses" links to target "ImGui::ImGui" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
src/CMakeLists.txt:6 (add_executable)
CMake Error at G:/programming/c++/vcpkg/scripts/buildsystems/vcpkg.cmake:148 (_add_executable):
Target "Multiverses" links to target "ImGui::ImGui" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
src/CMakeLists.txt:6 (add_executable)
CMake Error at G:/programming/c++/vcpkg/scripts/buildsystems/vcpkg.cmake:148 (_add_executable):
Target "Multiverses" links to target "ImGui::ImGui" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
src/CMakeLists.txt:6 (add_executable)
CMake Error at G:/programming/c++/vcpkg/scripts/buildsystems/vcpkg.cmake:148 (_add_executable):
Target "Multiverses" links to target "ImGui::ImGui" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
src/CMakeLists.txt:6 (add_executable)
-- Generating done
-- Build files have been written to: G:/programming/c++/multiverses/build
PS G:\programming\c++\multiverses\build>
Damn when I saved the files from Github it saved them to FindImGui.cmake.txt and FindMagnumIntegration.cmake.txt. Let me rename them!
from magnum-plugins.
Finally :
PS G:\programming\c++\multiverses\build> cmake .. -DCMAKE_TOOLCHAIN_FILE=G:\programming\c++\vcpkg\scripts\buildsystems/vcpkg.cmake
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.16.27027.1
-- The CXX compiler identification is MSVC 19.16.27027.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Corrade: G:/programming/c++/vcpkg/installed/x86-windows/include found components: Containers rc Utility
-- Found OpenGL: opengl32
-- Found SDL2: optimized;G:/programming/c++/vcpkg/installed/x86-windows/lib/SDL2.lib;debug;G:/programming/c++/vcpkg/installed/x86-windows/debug/lib/SDL2d.lib
-- Found Magnum: G:/programming/c++/vcpkg/installed/x86-windows/include found components: GL Shaders Sdl2Application
-- 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:/Program Files (x86)/Multiverses/lib
-- Found Magnum: G:/programming/c++/vcpkg/installed/x86-windows/include found components: GL
-- Found ImGui: G:/programming/c++/vcpkg/installed/x86-windows/include
-- Found MagnumIntegration: G:/programming/c++/vcpkg/installed/x86-windows/include found components: ImGui
-- Configuring done
-- Generating done
-- Build files have been written to: G:/programming/c++/multiverses/build
PS G:\programming\c++\multiverses\build>
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>Checking Build System
1>CMake does not need to re-run because G:/programming/c++/multiverses/build/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because G:/programming/c++/multiverses/build/src/CMakeFiles/generate.stamp is up-to-date.
2>------ Build started: Project: Multiverses, Configuration: Debug Win32 ------
2>Building Custom Rule G:/programming/c++/multiverses/src/CMakeLists.txt
2>CMake does not need to re-run because G:/programming/c++/multiverses/build/src/CMakeFiles/generate.stamp is up-to-date.
2>Multiverses.cpp
2>Multiverses.vcxproj -> G:\programming\c++\multiverses\build\src\Debug\Multiverses.exe
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
````
from magnum-plugins.
Alright I tried to use the example code from the ImGuiIntegration tutorial at : https://doc.magnum.graphics/magnum/examples-imgui.html
But I can't compile because of some RGB value in the code.
from magnum-plugins.
This literal is defined in the Math::Literals namespace, so you need to
using namespace Math::Literals;
to make use of it. The example code has this line, right?
from magnum-plugins.
Yeah you are right it is inside of the code but I missed it somehow because my code is a bit different from the example. It seems that using namespace can be used everywhere but I find it better to put all in the beginning.
from magnum-plugins.
Here I have another problem which is when I run in Debug and Release mode the app is working well. When I switch to MinSizef I get this error:
The translation in English is : The execution of the code can not continue because imgui.dll was not found.
Weird the file is there.
The CMakeList.txt from the example contains:
cmake_minimum_required(VERSION 3.1)
project(MagnumImGuiExample)
# Add module path in case this is project root
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/../../modules/")
endif()
find_package(Magnum REQUIRED GL Sdl2Application)
find_package(MagnumIntegration REQUIRED ImGui)
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
add_executable(magnum-imgui ImGuiExample.cpp)
target_link_libraries(magnum-imgui PRIVATE
Magnum::Application
Magnum::GL
Magnum::Magnum
MagnumIntegration::ImGui)
install(TARGETS magnum-imgui DESTINATION ${MAGNUM_BINARY_INSTALL_DIR})
Mine are two files:
Root
cmake_minimum_required(VERSION 3.1)
project(Multiverses)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/")
add_subdirectory(src)
Multiverses App
find_package(Magnum REQUIRED GL Shaders Sdl2Application)
find_package(MagnumIntegration REQUIRED ImGui)
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
add_executable(Multiverses Multiverses.cpp)
target_link_libraries(Multiverses PRIVATE
Magnum::Application
Magnum::GL
Magnum::Magnum
MagnumIntegration::ImGui)
install(TARGETS Multiverses DESTINATION ${MAGNUM_BINARY_INSTALL_DIR})
from magnum-plugins.
It's complaining about imguid.dll
, not imgui.dll
, and that file is not there. Not sure why vcpkg didn't copy it over -- it should be somewhere in the vcpkg package directories, if you copy it manually it should work.
It's also possible that Vcpkg (or the imgui Vcpkg package) works well only with Debug or Release and not MinSizeRel. Not many people use it, so maybe you hit a corner case that's not handled properly in the vcpkg package recipe for imgui.
from magnum-plugins.
I think I found what is the problem, it is in the Solution Configuration :
G:\programming\c++\vcpkg\installed\x86-windows\lib\MagnumSdl2Application.lib
G:\programming\c++\vcpkg\installed\x86-windows\lib\MagnumGL.lib
G:\programming\c++\vcpkg\installed\x86-windows\lib\Magnum.lib
G:\programming\c++\vcpkg\installed\x86-windows\lib\MagnumImGuiIntegration.lib
G:\programming\c++\vcpkg\installed\x86-windows\lib\SDL2.lib
opengl32.lib
G:\programming\c++\vcpkg\installed\x86-windows\lib\CorradeUtility.lib
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\imguid.lib
The last line:
G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\imguid.lib
Changed it for:
G:\programming\c++\vcpkg\installed\x86-windows\lib\imgui.lib
and it works. So it seems that at the generation stage CMake is not able to make the difference between Debug and MinSizef and Release
from magnum-plugins.
Does the file at G:\programming\c++\vcpkg\installed\x86-windows\debug\lib\imguid.lib
actually exist? Is the debug/lib
directory there at all?
To me this sounds like some strange packaging error (vcpkg to blame, not cmake), but looking at the vcpkg package for imgui, I wasn't able to find anything suspicious. Good to know you found a workaround.
from magnum-plugins.
The folder is correct with its content:
I don't know why we get that error.
from magnum-plugins.
Anything else to be done here? Otherwise I'll suggest closing this issue.
The above is most probably a packaging error in the ImGui vcpkg package, I can't really do anything about that.
from magnum-plugins.
Related Issues (20)
- AssimpImporter: Should normalize filepaths for external image paths HOT 1
- Static analyzer warning about variable used before initialization in TinyGltfImporter HOT 2
- Unable to install magnum-plugins.deb on Linux Mint 20.2 HOT 3
- KTX2 + Basis Universal HOT 4
- Attentuation for Directional/Sun Lights when importing Blender files HOT 3
- Wrong line ending normalization under Windows due to typo in .gitattributes HOT 1
- AssimpImporter: Embedded textures fail to load with FBX HOT 2
- meshoptimizersceneconverter build failed because meshoptimizer has updated HOT 1
- GltfImporter: spot light with outer angle of 90° produces error HOT 4
- Build Server Configuration Issue. HOT 10
- DrWavAudioImporterTest: cmake error when CORRADE_BUILD_STATIC=ON and BUILD_PLUGINS_STATIC=OFF HOT 2
- vcpkg does not work properly due to lib files not copied to the installed folder HOT 2
- CMake error (missing: AnyImageImporter) HOT 6
- Update Basis Universal plugin for UASTC HOT 4
- FindMagnumPlugins.cmake interaction with Assimp HOT 4
- AssimpImporter crashes on gltf/glb in wasm builds HOT 9
- Updating the basis plugin importer HOT 1
- Compile issues on osx HOT 4
- Expose Configuration Value implementation for Trade::BasisImporter::TargetFormat HOT 4
- Find modules have issues with paths containing spaces HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magnum-plugins.