mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-16 19:11:13 +00:00
Compiler error on Windows 7 #238
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#238
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?
Below is the only smallest example of code that does not compile.
I'm using Windows 7, msvc 2013, SDL 2.0.3.
The errors are as follows:
I tried to compile with and without
#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCSbut it didn't make a difference.Those functions are defined in msvc 2013 " User32.lib " which you need to link into.
IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS needs to be defined in imconfig.h for it to be seen while compiling imgui.cpp. Is that what you did? It should work and disable the use of those functions.
I'm compiling everything by hand, only using cl.exe and vim, so I don't have any win32 stuff in there by default. I will look at the imconfig.h and see if that works.
Normally user32.lib is linked automatically under Windows unless you ignored the default library or explicitly disabled it. I should probably use a link pragma there (and you can still disable it via imconfig.h)
It worked with the two #defines in the imconfig.h. I didn't look at that file at first, because I didn't know there was stuff in there. A quick note in the FAQ would fix this.
Note that if you are compiling and linking for Windows you are probably better of using the native clipboard facilities rather than disabling it.
I added the linking pragma now. I was already using it for IME input support and nobody reported an issue so it looks like this added one won't be a probelm.
Yep, that did it. Added the pragma, took out the #defines, and all is good.
Thanks for the quick response!
Cool. Good to hear!
FYI, leaving a note here for potential future readers stumbling here:
I have renamed those two defines that are usable (but very rarely used) in imconfig.h
IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCSbecameIMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS.IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCSbecameIMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS.Very few people will be affected and they will likely get a link error and therefore will notice.