-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Linking error with imgui[opengl3-glad-binding] #19231
Comments
Have you defined So if you haven't defined anything, imgui tries to detect the loader by itself. https://github.com/ocornut/imgui/blob/ad5d1a8429ea219d3d34e6a36a48918650402697/backends/imgui_impl_opengl3.h#L68 Not a vcpkg bug |
And just to expand it a bit further: |
Yes, I have thought of this. Adding this define to my source doesn't change anything. But that's not a surprise since the linker errors are emited from |
Oh yeah. I see. Sorry for the false info I gave. Actually that will be tricky now. Since the loader have to be known at compile time. I think there was somewhere a discussion to be able to add a custom imgui config file. But that's currently only possible with overlay ports. (would be now the fastest solution to your problem. Copy all sources from the imgui port, add a compile definition to the glad option in the cmake file and add the port as a overlay port) The long term solution needs discussion I think. |
Just to help you getting started with overlay ports: General overlay ports: If you are using manifests: |
@Dylan-Davies You may try to solve the problem refer to this #14753 (comment). Thanks for your help to look into this issue. |
Thanks for the suggestions. I have managed to make it work with an overlay port where I just added
as proposed in the other issue. Any reason why the problem shouldn't be solved just by adding the compile definitions for all backends like that? BTW, in the related issues some users complain about unable to use multiple bindings side by side. Maybe it would be a good idea to provide separate targets for the backends? That way we would have |
@Dylan-Davies Please see #14753 (comment) and #14753 (comment). |
@Dylan-Davies As you can see as follows: If you have installed We need to confirm with upstream if this is by design.
|
@NancyLi1013 please see #14753 (comment) and #14753 (comment) |
Yes, my understanding is that if you don't want the bindings to be auto-detected, you are supposed to define one of the |
Describe the bug
Trying to build an executable with
imgui[opengl3-glad-binding]
leads to a linking error. As you can see in the log snippet below, for some reason the linker is looking forglew
symbols instead ofglad
symbols.glew
andimgui[opengl3-glew-binding]
packages are not even installed.Environment
To Reproduce
The minimal example is as follows.
main.cpp
:CMakeLists.txt
:Expected behavior
I expect the executable to compile and link correctly. (The same example worked as expected when I tried it on Windows.)
Failure logs
The text was updated successfully, but these errors were encountered: