Linux: issue with ImTextureData::Status #8765

Closed
opened 2025-07-02 06:20:59 +00:00 by mklefrancois · 0 comments
mklefrancois commented 2025-07-02 06:20:59 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version 1.92 (Docking branch)

Back-ends:

imgui_impl_vulkan

Compiler, OS:

GCC

Full config/build information:

Details:

The issue shows when compiling with GCC. If vulkan.h is included before imgui.h, Xlib.h will be included and Status will be defined.

Would it be possible to undef Status in imgui.h? This would avoid changing many files and projects.

Example of errors

/imgui/imgui.h:3546:5: error: multiple types in one declaration
 3546 |     ImTextureStatus     Status;                 // rw   rw  // ImTextureStatus_OK/_WantCreate/_WantUpdates/_WantDestroy. Always use SetStatus() to modify!
      |     ^~~~~~~~~~~~~~~
imgui/imgui.h:3546:25: error: declaration does not declare anything [-fpermissive]
 3546 |     ImTextureStatus     Status;                 // rw   rw  // ImTextureStatus_OK/_WantCreate/_WantUpdates/_WantDestroy. Always use SetStatus() to modify!
      |                         ^~~~~~

Thanks

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

### Version/Branch of Dear ImGui: Version 1.92 (Docking branch) ### Back-ends: imgui_impl_vulkan ### Compiler, OS: GCC ### Full config/build information: ### Details: The issue shows when compiling with GCC. If `vulkan.h` is included before `imgui.h`, `Xlib.h` will be included and `Status` will be defined. Would it be possible to undef Status in imgui.h? This would avoid changing many files and projects. Example of errors ````C++ /imgui/imgui.h:3546:5: error: multiple types in one declaration 3546 | ImTextureStatus Status; // rw rw // ImTextureStatus_OK/_WantCreate/_WantUpdates/_WantDestroy. Always use SetStatus() to modify! | ^~~~~~~~~~~~~~~ imgui/imgui.h:3546:25: error: declaration does not declare anything [-fpermissive] 3546 | ImTextureStatus Status; // rw rw // ImTextureStatus_OK/_WantCreate/_WantUpdates/_WantDestroy. Always use SetStatus() to modify! | ^~~~~~ ```` Thanks ### Screenshots/Video: _No response_ ### Minimal, Complete and Verifiable Example code:
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#8765
No description provided.