Alright, I've read two dozen threads with this exact same problem in this forum, but none of the advice that helped other posters has helped me, and I'm at my wit's end. I'm just running a test project only to get ImGui-SFML working. ImGui and SFML seem to be working in the project on their own, but I'm getting linker errors on all ImGui-SFML functions called in my test code. (It's simple test code that runs fine when the ImGui-SFML functions are commented out.)
Code is from Elias Daler's blog:
https://edw.is/using-imgui-with-sfml-pt1/I followed all instructions from his Option C "manual integration" for install.
Things I have tried or verified:
- opengl32.lib is added to the linker input
- so are all the sfml .dlls as recommended in a video (sfml-system-s-d, sfml-window-s-d etc)
- I am using SFML_STATIC in the preprocessor
- SFML version is the same as the C++ version used in my project (17)
- I copied the #includes and defines from imconfig-sfml.h into imconfig.h as recommended
- I changed the #included files between using double quotes and angle brackets (some people said this helped, not for me)
- I added the ImGui-SFML source code location to the Additional Include Directories
- I simply included the ImGui-SFML .cpps and .hs in my project directory
In various threads, some of this advice fixed the linker errors for the OPs, but none of it has worked for me.
I'm using Win10, Visual Studio 2022 and MSVC as eventually this needs to be a Windows app. The only advice I found that I haven't acted on is to compile and build it separately, and link against the project. That shouldn't be necessary in this case, right? Is that best practice? I'm fairly new to this so if anyone knows differently please let me know.
Any advice welcome. Thanks.