Only post here if you can't Build/Link/Run or can't Load Font Files (OTHER TOPICS WILL BE DELETED) #4497
Replies: 6 comments 9 replies
-
Hi, I am unsure of how to build or link ImGUI. I imported a bunch of the files that seemed relevant (everything in root, and then under opengl3 in backend). Got undefined references and edited my cmakelists file to include the cpp files but the undefined references just kept growing. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
![vulkan_include_error](https://user-images.githubusercontent.com/97351534/233704000-a2023241-2b7e-485b-80bc-005984c73aee.png am getting started with imgui_docking. and i seem to have no "vulkan/vulkan.h" file. |
Beta Was this translation helpful? Give feedback.
-
I've downloaded the github repo in VS and built the projects updated whatever / the examples do not work due the SDL.h not being found; so anything besides DX9 doesnt work. |
Beta Was this translation helpful? Give feedback.
-
Using OpenGL3 GLFW and Glad with ImGui latest docking version. Compiling with If I delete the docking related codes the program can compile and run, with two individual imgui windows floating above the opengl background. Although I don't know how to move the opengl rendering background into one of the two imgui windows. The main code is as follows: while (!glfwWindowShouldClose(MainWindow))
{
glfwPollEvents();
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Start the Dear ImGui frame
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
// ImGui::ShowDemoWindow(); // Show demo window! :)
const auto &viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->Pos);
ImGui::SetNextWindowSize(viewport->Size);
ImGui::SetNextWindowViewport(viewport->ID);
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_PassthruCentralNode;
ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;
if (dockspace_flags & ImGuiDockNodeFlags_PassthruCentralNode)
window_flags |= ImGuiWindowFlags_NoBackground;
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
ImGui::Begin("DockSpace", nullptr, window_flags);
ImGui::PopStyleVar();
ImGui::PopStyleVar(2);
// DockSpace
ImGuiIO &io = ImGui::GetIO();
if (io.ConfigFlags & ImGuiConfigFlags_DockingEnable)
{
auto dockspaceId = ImGui::DockSpaceOverViewport(viewport);
ImGui::DockSpace(dockspaceId, ImVec2{0.0f, 0.0f}, ImGuiDockNodeFlags_PassthruCentralNode);
static bool init = true;
if (init)
{
ImGui::DockBuilderRemoveNode(dockspaceId); // error
ImGui::DockBuilderAddNode(dockspaceId, dockspace_flags | ImGuiDockNodeFlags_DockSpace); // error
ImGui::DockBuilderSetNodeSize(dockspaceId, viewport->Size); // error
auto dock_id_left = ImGui::DockBuilderSplitNode(dockspaceId, ImGuiDir_Left, 0.2f, nullptr, &dockspaceId); // error
auto dock_id_right = ImGui::DockBuilderSplitNode(dockspaceId, ImGuiDir_Right, 0.8f, nullptr, &dockspaceId); // error
ImGui::DockBuilderDockWindow("Right", dock_id_right); // error
ImGui::DockBuilderDockWindow("Left", dock_id_left); // error
ImGui::DockBuilderFinish(dockspaceId); // error
init = false;
}
}
ImGui::End();
ImGui::Begin("Left");
ImGui::Text("Text 1");
ImGui::End();
ImGui::Begin("Right");
ImGui::Text("Text 2");
renderOpenGLContent(SunShader, EarthShader, VehicleShader, CelebodyShader,
SkyboxShader, Sun, Earth, Moon, Spacecraft,
skybox, texture_sun, texture_earth, texture_earth_night,
texture_earth_cloud, texture_earth_watermask,
texture_earth_normal, texture_moon);
ImGui::End();
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{
GLFWwindow *backup_current_context = glfwGetCurrentContext();
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindowsDefault();
glfwMakeContextCurrent(backup_current_context);
}
glfwSwapBuffers(MainWindow);
}
detailed errors are like: [build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp: In function 'int RenderMainWindow()':
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:787:24: error: 'DockBuilderRemoveNode' is not a member of 'ImGui'
[build] 787 | ImGui::DockBuilderRemoveNode(dockspaceId); // clear any previous layout
[build] | ^~~~~~~~~~~~~~~~~~~~~
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:788:24: error: 'DockBuilderAddNode' is not a member of 'ImGui'
[build] 788 | ImGui::DockBuilderAddNode(dockspaceId, dockspace_flags | ImGuiDockNodeFlags_DockSpace);
[build] | ^~~~~~~~~~~~~~~~~~
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:788:74: error: 'ImGuiDockNodeFlags_DockSpace' was not declared in this scope; did you mean 'ImGuiDockNodeFlags_NoSplit'?
[build] 788 | ImGui::DockBuilderAddNode(dockspaceId, dockspace_flags | ImGuiDockNodeFlags_DockSpace);
[build] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[build] | ImGuiDockNodeFlags_NoSplit
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:789:24: error: 'DockBuilderSetNodeSize' is not a member of 'ImGui'
[build] 789 | ImGui::DockBuilderSetNodeSize(dockspaceId, viewport->Size);
[build] | ^~~~~~~~~~~~~~~~~~~~~~
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:794:44: error: 'DockBuilderSplitNode' is not a member of 'ImGui'
[build] 794 | auto dock_id_left = ImGui::DockBuilderSplitNode(dockspaceId, ImGuiDir_Left, 0.2f, nullptr, &dockspaceId);
[build] | ^~~~~~~~~~~~~~~~~~~~
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:795:45: error: 'DockBuilderSplitNode' is not a member of 'ImGui'
[build] 795 | auto dock_id_right = ImGui::DockBuilderSplitNode(dockspaceId, ImGuiDir_Right, 0.8f, nullptr, &dockspaceId);
[build] | ^~~~~~~~~~~~~~~~~~~~
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:798:24: error: 'DockBuilderDockWindow' is not a member of 'ImGui'
[build] 798 | ImGui::DockBuilderDockWindow("Right", dock_id_right);
[build] | ^~~~~~~~~~~~~~~~~~~~~
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:799:24: error: 'DockBuilderDockWindow' is not a member of 'ImGui'
[build] 799 | ImGui::DockBuilderDockWindow("Left", dock_id_left);
[build] | ^~~~~~~~~~~~~~~~~~~~~
[build] D:\Works\github\digital-spacecraft\src\scene\ShowWindow.cpp:800:24: error: 'DockBuilderFinish' is not a member of 'ImGui'
[build] 800 | ImGui::DockBuilderFinish(dockspaceId);
[build] | ^~~~~~~~~~~~~~~~~
[build] mingw32-make.exe[2]: *** [src\scene\CMakeFiles\DSScene.dir\build.make:241: src/scene/CMakeFiles/DSScene.dir/ShowWindow.cpp.obj] Error 1
[build] mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:897: src/scene/CMakeFiles/DSScene.dir/all] Error 2
[build] mingw32-make.exe: *** [Makefile:165: all] Error 2 |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm getting errors related to the font stack; specifically, when I try to initialize ImGui an assert in this function is being triggered. The asserts in line 9808, 9815, 9816, and 9817 of the second screenshot are also being triggered every time. Does anyone know what could be the most likely cause of these errors? The code I'm using is rather complex (custom camera tools for a game), and a prebuilt version works fine, but when I try to compile the tools from source I get these errors when initializing ImGui in game. Please let me know if you'd like a link to it. |
Beta Was this translation helpful? Give feedback.
-
This category is for people Getting Started with Dear ImGui.
Please post in this forum if you are Getting Started and:
== if Dear ImGui is not showing in your app.
If Dear ImGui is successfully showing in your app, please search for Issues or open an Issue.
If you an existing user of Dear ImGui and an update/commit broke build or runtime for you please open an Issue, not a Discussion post.
References:
Beta Was this translation helpful? Give feedback.
All reactions