-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Compiler error on Windows 7 #238
Comments
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. |
… function (unless IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS) #238
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 Very few people will be affected and they will likely get a link error and therefore will notice. |
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_FUNCS
but it didn't make a difference.The text was updated successfully, but these errors were encountered: