SFML / imgui-sfml

Dear ImGui backend for use with SFML
MIT License
1.13k stars 169 forks source link

X is not a member of sf::Joystick #290

Closed lazzybunny closed 1 month ago

lazzybunny commented 2 months ago

Good morning, i've got in issue with imgui-sfml

My error is

error: 'X' is not a member of 'sf::Joystick'
  157 |   sf::Joystick::Axis xAxis{sf::Joystick::X};
      |                                          ^
C:\bones\bones_source\src\include\imgui\imgui-SFML.cpp:157:42: note: suggested alternatives:
In file included from C:\bones\bones_source\src\include\imgui\imgui-SFML.h:8,
                 from C:\bones\bones_source\src\include\imgui\imgui-SFML.cpp:1:
C:/bones/bones_source/src/include/SFML/include/SFML/Window/Joystick.hpp:56:5: note:   'sf::Joystick::Axis::X'
   56 |     X,    //!< The X axis
      |     ^
In file included from C:/bones/bones_source/src/include/SFML/include/SFML/Window/Event.hpp:33,
                 from C:/bones/bones_source/src/include/SFML/include/SFML/Window/WindowBase.inl:28,
                 from C:/bones/bones_source/src/include/SFML/include/SFML/Window/WindowBase.hpp:601,
                 from C:/bones/bones_source/src/include/SFML/include/SFML/Window/Window.hpp:32,
                 from C:/bones/bones_source/src/include/SFML/include/SFML/Graphics/RenderWindow.hpp:36,
                 from C:\bones\bones_source\src\include\imgui\imgui-SFML.cpp:8:
C:/bones/bones_source/src/include/SFML/include/SFML/Window/Keyboard.hpp:198:5: note:   'sf::Keyboard::Scan::X'
  198 |     X,            //!< Keyboard x and X key

...e.t.c.

Is that mean that i using wrong version of SFML or imgui-sfml, or is that some kind of other problem ?

eliasdaler commented 2 months ago

What branch of ImGui-SFML are you on? What SFML are you using? If you're on SFML 2.6.1 corresponds to 2.6.x branch of ImGui-SFML. If you're on SFML master, you should checkout to ImGui-SFML master.

eliasdaler commented 2 months ago

@ChrisThrasher - what about making "master" branch the default? It seems like most people won't care about SFML 2.6.1/"stable" these days, and those who do are more likely to read README, haha (these days many people just clone the "default" branch and expect everything to work out of the box)

lazzybunny commented 2 months ago

I was using 2.6.x branch for imgui-sfml SFML 3.0.0 And ImGUI docking branch

Now i changed the SFML to 2.6.x branch, imgui-sfml to 2.6.x branch and imgui stay docking branch but now i've got this error

C:\mingw64\bin\windres.exe: C:\\bones\\bones_build\\src\\include\\SFML\\src\\SFML\\System\\sfml-system.rc:35: syntax error
mingw32-make[2]: *** [src\include\SFML\src\SFML\System\CMakeFiles\sfml-system.dir\build.make:314: src/include/SFML/src/SFML/System/CMakeFiles/sfml-system.dir/sfml-system.rc.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:501: src/include/SFML/src/SFML/System/CMakeFiles/sfml-system.dir/all] Error 2
mingw32-make: *** [makefile:135: all] Error 2

build.make:314 is

cd /d C:\bones\bones_build\src\include\SFML\src\SFML\System && C:\mingw64\bin\windres.exe -O coff $(RC_DEFINES) $(RC_INCLUDES) $(RC_FLAGS) C:\bones\bones_build\src\include\SFML\src\SFML\System\sfml-system.rc CMakeFiles\sfml-system.dir\sfml-system.rc.obj

if i try to open sfml-system.rc file it says

fatal error RC1015: cannot open include file 'winresrc.h'
lazzybunny commented 2 months ago

i tried to just add winresrc.h file, but it doesn't helped

at makefile:135: all - is:

cd /d C:\bones\bones_build && $(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 src/include/SFML/src/SFML/System/all
eliasdaler commented 1 month ago

Doesn't look like ImGui-SFML problem to me, try to get simple SFML window to compile first.

ChrisThrasher commented 1 month ago

@ChrisThrasher - what about making "master" branch the default?

This is what I always wanted to do so I'm happy to make this change.

lazzybunny commented 1 month ago

@eliasdaler Yeah, you were right! This was a version compare issue, i'm switched back to the MSVC and remade all CMakeLists files and used FetchContent except of source files, thanks a lot, problem solved :)