Skip to content
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

[MSVC] Compile error in sample_benchmark.cpp due to recent changes in ocornut/imgui #835

Closed
NEIL-smtg opened this issue Nov 8, 2024 · 1 comment

Comments

@NEIL-smtg
Copy link

Hi, I work on MSVC compiler testing, and we regularly build popular open-source project such as box2d, with development builds of MSVC in order to find and fix regressions before they ship and cause problems for you.

Recently, as I tried to build box2d from source, I encountered the following error:

C:\gitP\erincatto\box2d\samples\sample_benchmark.cpp(1329,37): error C2662: 'const ImFontGlyph *ImFont::FindGlyph(ImWchar)': cannot convert 'this' pointer from 'const ImFont' to 'ImFont &'
C:\gitP\erincatto\box2d\samples\sample_benchmark.cpp(1329,31): note: Conversion loses qualifiers
C:\gitP\erincatto\box2d\build\imgui\imgui.h(3566,33): note: see declaration of 'ImFont::FindGlyph'
C:\gitP\erincatto\box2d\samples\sample_benchmark.cpp(1329,37): note: while trying to match the argument list '(const char)'

I found that this issue is likely due to recent changes made in imgui.h and imgui_draw.cpp within the ocornut/imgui repository. The relevant commit can be found here: ocornut/imgui@0bde57c#diff-cbc47f9fc55eb2c19b4be92d1c1e137bb8b72d072588ab3cb4bcba88576d14cbR3474

Could you please let me know if you are planning to update your code to align with these recent changes? Or would you prefer that I report this issue directly to the ocornut/imgui.

Repro Steps:

  1. Open x64 native tools command prompt for VS 2022
  2. git clone https://github.com/erincatto/box2d.git
  3. cd erincatto/box2d
  4. mkdir build_amd64
  5. cd build_amd64
  6. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 .. 2>&1
  7. msbuild /m /p:Platform=x64 /p:Configuration=Release box2d.sln /t:Rebuild 2>&1

Build log: b2d.txt

@NEIL-smtg NEIL-smtg changed the title [MSVC] Compiler error in sample_benchmark.cpp due to recent changes in ocornut/imgui [MSVC] Compile error in sample_benchmark.cpp due to recent changes in ocornut/imgui Nov 8, 2024
erincatto added a commit that referenced this issue Nov 8, 2024
- adjusted AABB margin based on performance testing
- compute rotation between vectors
- added macOS samples to GitHub actions

#833, #835
@erincatto
Copy link
Owner

Fixed in #829

zero-meta pushed a commit to labolado/submodule-box2d_v3 that referenced this issue Nov 12, 2024
- adjusted AABB margin based on performance testing
- compute rotation between vectors
- added macOS samples to GitHub actions

erincatto#833, erincatto#835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants