geogram icon indicating copy to clipboard operation
geogram copied to clipboard

Compiling geogram with the latest version of imgui in vcpkg fails to compile

Open jimwang118 opened this issue 2 years ago • 10 comments

1.The version of imgui used by geogram in the library is 1.89.4, but some errors appear when compiling with the latest version of imgui. F:\vcpkg\buildtrees\geogram\src\v1.8.3-0e25e29abd\src\lib\geogram_gfx\ImGui_ext\imgui_ext.cpp(409,35): error C2065: 'ImGuiWindowFlags_NoDocking': undeclared identifier

2.The latest version of imgui deletes the definition of the following variables.

ImGuiWindowFlags_NoDocking
ImGuiCol_DockingPreview
ImGuiCol_DockingEmptyBg

3.Does geogram compilation have to rely on imgui version 1.89.4 or will it be updated to the latest version imgui?

jimwang118 avatar Jul 12 '23 06:07 jimwang118

It will be updated in next release.

BrunoLevy avatar Jul 12 '23 06:07 BrunoLevy

It is weird, I have updated to imgui 1.89.5 WIP, and there three constants are there (and are not declared as deprecated either). Are you sure you are not using an older (instead of more recent) version of imgui ?

BrunoLevy avatar Jul 21 '23 18:07 BrunoLevy

It is weird, I have updated to imgui 1.89.8 WIP, and there three constants are there (and are not declared as deprecated either). Are you sure you are not using an older (instead of more recent) version of imgui ?

src\lib\geogram_gfx\third_party\imgui, the imgui used in this path is still version 1.89.4, and imgui is a link when installing in vcpkg, and the code will not be downloaded automatically.

jimwang118 avatar Jul 24 '23 07:07 jimwang118

Oooh I think I see, the version of the docking branch may be different.

BrunoLevy avatar Jul 24 '23 07:07 BrunoLevy

If the graphics feature is enabled when installing geogram, an error will be reported that imgui/imgui.cpp cannot be found.

jimwang118 avatar Jul 24 '23 07:07 jimwang118

I see that docking branch's imgui.h has a version 1.89.8. It has the three constants.

I guess that the folks who packaged it for vcpkg did not pull the docking branch. Do you know if there is a way to report the issues to them ? (I am not familiar with vcpkg)

Best thing to do is probably filing an issue here

BrunoLevy avatar Jul 24 '23 08:07 BrunoLevy

Would you explain me how to reproduce the problem ? (which command did you type ?), I'm not familiar with vcpkg. I may have an idea to make it work with a version of imgui that does not have the docking branch...

BrunoLevy avatar Jul 26 '23 12:07 BrunoLevy

Host Environment

Host: x64-osx
Compiler: AppleClang 14.0.3.14030022
vcpkg package management program version 2023-06-22-f19f3d9939100085fe2f7e41502d60b08e2083b6

Steps to reproduce:

1. git clone vcpkg
2. cd vcpkg & .\bootstrap-vcpkg.bat
3. .\vcpkg install geogram"[graphics]"

jimwang118 avatar Jul 27 '23 06:07 jimwang118

Thanks ! (I'll take a look and tell you)

BrunoLevy avatar Jul 27 '23 13:07 BrunoLevy

Examining the geogram port for vcpkg, I think that:

  • vcpkg does not know about geogram depending on imgui
  • there may be a version of imgui installed in your system (else it would complain about not finding it)
  • this version of imgui does not have the docking and viewport branches (required by geogram)

The "right way" of doing it will be sending a pull request to vcpkg package maintainer that insert the correct dependency to imgui in the geogram vcpkg package.

I have seen you have done it already here, wonderful !

In the meanwhile, before the vcpkg package is fixed, you may install and compile on your own dearimgui (with the docking and the viewport branches):

  1. Get the docking and viewport branch of imgui:
   git clone --branch docking https://github.com/ocornut/imgui.git
  1. Compile and install it in your system (depends on your system and on where vcpkg expects to find it, you may search for the existing version of imgui.h in your system to figure out)

BrunoLevy avatar Jul 28 '23 14:07 BrunoLevy