mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-10 19:03:30 +00:00
redundant #include of module 'std.depr.string_h' appears within namespace 'ImStb' #4791
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#4791
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dear ImGui 1.86 WIP (18502)
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=202002
define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS
define: linux
define: GNUC=4
define: clang_version=12.0.1
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
Version/Branch of Dear ImGui:
Version: Dear ImGui 1.86 WIP (18502)
Branch: docking
Back-end/Renderer/Compiler/OS
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
Compiler: Clang 12
Operating System: Linux Mint 19.3
My Issue/Question:
I am having a strange compilation error from
imstb_textedit.h:387The error disappears if I comment that line:
ocornut/imgui@fc198fe1db/imstb_textedit.h (L387)Screenshots/Video
Standalone, minimal, complete and verifiable example:
It is complicated to isolate it, it is part of a big project, but I updated ImGui recently and today I deleted the build and cache dirs and rebuild everything and i get this error.
I am not sure what is happening, maybe someone have seen this before.
Neither STB nor Dear ImGui libraries support modules currently, therefore you should not try to build Dear ImGui with
-fmodule. You could build Dear ImGui as a static library not using modules and then export library interface like so:Thank you @rokups .
The issue is that the
#includehappens within namespaceImStb:ocornut/imgui@f1781c20a3/imgui_internal.h (L206-L208)ocornut/imgui@f1781c20a3/imstb_textedit.h (L390)I'm not compiling Dear ImGui as a module,
but using Clang Modules,
which performs include translation on
#include <string.h>.Can I provide a PR to close and reopen the namespace between the
#include?Since it seems to only happen here I would define the memmove define the lib is using to avoid the include.
I will leave that to a more brave soul.
I don't know if the uses of
memmoveinimstb_textedit.hare performance sensitiveand don't feel like attempting to write a version that competes with the one in
<string.h>.For now, I just unwrapped the namespace around the
#includein #6653.I meant that just specifying “ #define STB_TEXTEDIT_memmove memmove” on our end would completely side-step the problem, since we already have included the header and have access to memmove.
I understand.
I suspected it was already included, given the error message.
I will readjust the PR.
Your readjustment seems to be doing something else (you removed include from stb_textedit.h)
I'll push a separate commit with the correct solution.