Skip to content

imgui_impl_sdl3 build error #7807

Closed
Closed

Description

Version/Branch of Dear ImGui:

Version 1.91, Branch: master

Back-ends:

imgui_impl_sdl3.cpp

Compiler, OS:

Linux + GCC

Full config/build information:

No response

Details:

imgui_impl_sdl3.cpp throws errors on build
Hello, first time posting and learning SDL3 alongside ImGui.

Upon adding imgui_impl_sdl3.cpp to my project and running cmake build, I was shown the following error:

  • imgui/backends/imgui_impl_sdl3.cpp:642:55: error: invalid conversion from ‘const SDL_JoystickID*’ {aka ‘const unsigned int*’} to ‘SDL_JoystickID*’ {aka ‘unsigned int*’}
  • SDL_JoystickID* sdl_gamepads = SDL_GetGamepads(&sdl_gamepads_count); const SDL_JoystickID* {aka const unsigned int*}

I added 'const' within the file, which seemed to fix it but I was greeted with another error:

  • imgui/backends/imgui_impl_sdl3.cpp:650:18: error: invalid conversion from ‘const void*’ to ‘void*’
  • SDL_free(sdl_gamepads); const void*

I don't know how to fix that and have made the assumptions that the file may contain more issues after one has been fixed. So, I decided to write this issue.

I hope it helps!

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

Activity

  1. ocornut commented on Jul 21, 2024

    @ocornut
    Owner

    SDL3 is currently unstable and its api has been evolving very quickly lately, so it breaks probably once a week. Will fix tomorrow, or you can try to checkout a version of SDL3 before they made this change a few days ago.

  2. ocornut commented on Jul 22, 2024

    @ocornut
    Owner

    Fixed with eb72b5a
    See SDL3 commit libsdl-org/SDL@4961af4

  3. added a commit that references this issue on Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址