Help needed to build example for glfw and opengl3


#1

Hi , I really want to try and use imGui, it seems awesome, but I have some troubles getting started.
I am on linux ‘Jessie’ and trying to compile the example for glmf and opengl3 generates this command :

g++ -lGLEW -DIMGUI_IMPL_OPENGL_LOADER_GLEW -I../ -I../../  `pkg-config --cflags glfw3` -Wall -Wformat -c -o imgui_impl_glfw.o ../imgui_impl_glfw.cpp 

and gives me this error :

../imgui_impl_glfw.cpp:60:8: error: ‘GLFWcursor’ does not name a type
 static GLFWcursor*          g_MouseCursors[ImGuiMouseCursor_COUNT] = { 0 };
    ^
../imgui_impl_glfw.cpp: In function ‘bool ImGui_ImplGlfw_Init(GLFWwindow*, bool, GlfwClientApi)’:
../imgui_impl_glfw.cpp:166:5: error: ‘g_MouseCursors’ was not declared in this scope
 g_MouseCursors[ImGuiMouseCursor_Arrow] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
 ^
../imgui_impl_glfw.cpp:166:71: error: ‘GLFW_ARROW_CURSOR’ was not declared in this scope
 g_MouseCursors[ImGuiMouseCursor_Arrow] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
                                                                   ^
../imgui_impl_glfw.cpp:166:88: error: ‘glfwCreateStandardCursor’ was not declared in this scope
 g_MouseCursors[ImGuiMouseCursor_Arrow] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
                                                                                    ^
../imgui_impl_glfw.cpp:167:75: error: ‘GLFW_IBEAM_CURSOR’ was not declared in this scope
 g_MouseCursors[ImGuiMouseCursor_TextInput] = glfwCreateStandardCursor(GLFW_IBEAM_CURSOR);

I have glfw installed and working.
I tried fiddling with the MakeFile but I don’t really know what I am doing, and the g++ command seems fine to me in the first place.

I must be missing something but I really don’t know what. Help me please :sob:


#2

GLFWcursor was added in GLFW 3.1 you are probably using an older version.


#3

Thank you for the info , but ,
beginner follow up question : how do you update glfw on linux ?
I downloaded sources for glfw 3.2 and built them succesfully on my raspberry pi. I then replaced header files in /usr/include/GLFW/
I imagine a also have to update somehow the lib file , but I am a little lost here.
Building glfw generated a libglfw.a ( not exactly that name but something like that) is this the lib file I need to build against ?
Edit :
I built glfw wrong, I did’nt ‘make install’
Everything builds fine now.
I have an glfw error on lauching the executable , the demo window runs fine though)
Error is : Glfw Error 65544: RandR gamma ramp support seems broken