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

Make fails with error: use of undeclared identifier 'ImGuiKey_KeyPadEnter' #1

Closed
dsego opened this issue Dec 18, 2024 · 3 comments
Closed

Comments

@dsego
Copy link
Contributor

dsego commented Dec 18, 2024

make -j 4
[  2%] Built target glad
[  4%] Built target stb_hello_imgui
[ 16%] Built target plutovg
[ 20%] Built target plutosvg
[ 20%] Built target smiley
[ 28%] Built target imgui
[ 97%] Built target hello_imgui
Copying OS X content rpn_calculator.app/Contents/Resources/icon.icns
[ 98%] Building CXX object CMakeFiles/rpn_calculator.dir/rpn_calculator_app.cpp.o
/Users/davorin/Code/rpn_calculator/rpn_calculator_app.cpp:348:68: error: use of undeclared identifier 'ImGuiKey_KeyPadEnter'; did you mean 'ImGuiKey_KeypadEnter'?
  348 |     if (ImGui::IsKeyPressed(ImGuiKey_Enter) || ImGui::IsKeyPressed(ImGuiKey_KeyPadEnter))
      |                                                                    ^~~~~~~~~~~~~~~~~~~~
      |                                                                    ImGuiKey_KeypadEnter
/Users/davorin/Code/rpn_calculator/build/_deps/hello_imgui-src/external/imgui/imgui.h:1539:5: note: 'ImGuiKey_KeypadEnter' declared here
 1539 |     ImGuiKey_KeypadEnter,
      |     ^
1 error generated.
make[2]: *** [CMakeFiles/rpn_calculator.dir/rpn_calculator_app.cpp.o] Error 1
make[1]: *** [CMakeFiles/rpn_calculator.dir/all] Error 2
make: *** [all] Error 2

Updating ImGuiKey_KeyPadEnter to ImGuiKey_KeypadEnter in rpn_calculator_app.cpp (line 348) fixes the issue for me.
Could be related to Imgui change here ocornut/imgui#7143 .

@dsego dsego changed the title Make fails on MacOS Make fails with error: use of undeclared identifier 'ImGuiKey_KeyPadEnter' Dec 18, 2024
@pthom
Copy link
Owner

pthom commented Dec 18, 2024

Hello
Thank you! you probably found the reason for the issue.
Could you test the fix on your side, and if it works, could you also propose a PR which solves the issue here ?
Thanks

@dsego
Copy link
Contributor Author

dsego commented Dec 18, 2024

Ok, this seems to be the actual change
ocornut/imgui#2625

Specifically this commit
ocornut/imgui@afffcd5

Inputs: rename ImGuiKey_KeyPadEnter > ImGuiKey_KeypadEnter (ocornut/imgui#2625)

This is the version pulled in rpn_calculator/build/_deps/hello_imgui-src/external/imgui
dear imgui, v1.91.5

And this method was renamed in dear imgui v1.90.1
https://github.com/ocornut/imgui/releases/tag/v1.90.1

PR for review
#2

@pthom
Copy link
Owner

pthom commented Dec 18, 2024

Thanks a lot, I merged your PR!

@pthom pthom closed this as completed Dec 18, 2024
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