Closed xzripper closed 11 months ago
You need to add imgui_draw.cpp
to your build.
It reduced amount of the errors, but I still getting some errors:
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x107f): undefined reference to `sf::Touch::isDown(unsigned int)'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x109b): undefined reference to `sf::Touch::getPosition(unsigned int, sf::WindowBase const&)'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x1121): undefined reference to `sf::Mouse::getPosition(sf::WindowBase const&)'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x1233): undefined reference to `sf::Mouse::setPosition(sf::Vector2<int> const&)'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x1299): undefined reference to `sf::Touch::isDown(unsigned int)'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x12ba): undefined reference to `sf::Mouse::isButtonPressed(sf::Mouse::Button)'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x20a0): undefined reference to `sf::RenderTexture::getTexture() const'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x21a2): undefined reference to `sf::Sprite::getGlobalBounds() const'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2207): undefined reference to `sf::Sprite::getTexture() const'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2247): undefined reference to `sf::Sprite::getTextureRect() const'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2573): undefined reference to `sf::RenderTexture::getTexture() const'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x267e): undefined reference to `sf::Sprite::getGlobalBounds() const'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x26ea): undefined reference to `sf::Sprite::getTexture() const'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2730): undefined reference to `sf::Sprite::getTextureRect() const'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2c2e): undefined reference to `__imp_glEnable'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2c41): undefined reference to `__imp_glBlendFunc'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2c4f): undefined reference to `__imp_glDisable'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2c5d): undefined reference to `__imp_glDisable'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2c6b): undefined reference to `__imp_glDisable'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2c79): undefined reference to `__imp_glDisable'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2c87): undefined reference to `__imp_glDisable'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2c95): undefined reference to `__imp_glEnable'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2ca3): undefined reference to `__imp_glEnableClientState'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2cb1): undefined reference to `__imp_glEnableClientState'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2cbf): undefined reference to `__imp_glEnableClientState'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2ccd): undefined reference to `__imp_glDisableClientState'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2cdb): undefined reference to `__imp_glEnable'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2cee): undefined reference to `__imp_glPolygonMode'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2cfc): undefined reference to `__imp_glShadeModel'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2d15): undefined reference to `__imp_glTexEnvi'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2d34): undefined reference to `__imp_glViewport'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2d42): undefined reference to `__imp_glMatrixMode'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2d4b): undefined reference to `__imp_glPushMatrix'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2d54): undefined reference to `__imp_glLoadIdentity'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2de1): undefined reference to `__imp_glOrtho'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2def): undefined reference to `__imp_glMatrixMode'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2df8): undefined reference to `__imp_glPushMatrix'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2e01): undefined reference to `__imp_glLoadIdentity'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2edf): undefined reference to `__imp_glGetIntegerv'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2ef4): undefined reference to `__imp_glGetIntegerv'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2f09): undefined reference to `__imp_glGetIntegerv'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2f1e): undefined reference to `__imp_glGetIntegerv'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2f33): undefined reference to `__imp_glGetIntegerv'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2f4d): undefined reference to `__imp_glGetTexEnviv'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2f5b): undefined reference to `__imp_glPushAttrib'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x2fe7): undefined reference to `__imp_glVertexPointer'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x300b): undefined reference to `__imp_glTexCoordPointer'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x302f): undefined reference to `__imp_glColorPointer'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x3235): undefined reference to `__imp_glScissor'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x325b): undefined reference to `__imp_glBindTexture'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x328f): undefined reference to `__imp_glDrawElements'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x32c4): undefined reference to `__imp_glDisableClientState'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x32d2): undefined reference to `__imp_glDisableClientState'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x32e0): undefined reference to `__imp_glDisableClientState'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x32f3): undefined reference to `__imp_glBindTexture'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x3301): undefined reference to `__imp_glMatrixMode'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x330a): undefined reference to `__imp_glPopMatrix'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x3318): undefined reference to `__imp_glMatrixMode'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x3321): undefined reference to `__imp_glPopMatrix'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x332a): undefined reference to `__imp_glPopAttrib'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x333d): undefined reference to `__imp_glPolygonMode'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x3350): undefined reference to `__imp_glPolygonMode'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x336e): undefined reference to `__imp_glViewport'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x338c): undefined reference to `__imp_glScissor'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x339a): undefined reference to `__imp_glShadeModel'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x33b3): undefined reference to `__imp_glTexEnvi'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x3a30): undefined reference to `sf::Clipboard::setString(sf::String const&)'
c:/users/ione/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\IonE\AppData\Local\Temp\ccXZzCjV.o:imgui-SFML.cpp:(.text+0x3a7b): undefined reference to `sf::Clipboard::getString()'
Any thoughts?
Seems like SFML is not linking properly. Does SFML work without imgui-sfml?
Also try moving ImGui’s .cpp files before -o flag. I don’t know how to manually compile with gcc, so I’d really suggest using CMake, otherwise I can’t help here.
No way it's fixed the problem (moving ImGui's .cpp files before -o flag). BIGGEST THANK YOU!
By the way, is it OK?
You’re probably rendering ImGui before drawing the shape?
Yeah, also solved, thank you!
My project tree:
My run command:
g++ test.cpp -o test.exe -std=c++11 -Wall -DSFML_STATIC -I SFML\include\ -I imgui\include\ -L SFML\lib -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32 -lfreetype imgui\include\imgui.cpp imgui\include\imgui_widgets.cpp imgui\include\imgui_tables.cpp imgui\include\imgui-SFML.cpp
Errors i'm getting:
How do I fix it and make it properly?