I am learning opengl and decided to use imgui to an working existing opengl cmake project by adding following files in the project:
target_sources(Application PRIVATE
vendor/include/imgui/imgui.cpp
vendor/include/imgui/imgui_draw.cpp
vendor/include/imgui/imgui_impl_glfw.cpp
vendor/include/imgui/imgui_impl_opengl3.cpp
vendor/include/imgui/imgui_widgets.cpp
vendor/glad/glad.c
vendor/include/stb_image/stb_image.c
src/Indexbuffer.cpp
src/Shader.cpp
src/Texture.cpp
src/Vertexarray.cpp
src/Vertexbuffer.cpp
)
while this works fine on windows but when i build it in linux linker shows error saying:
in function `ImGui_ImplOpenGL3_Init(char const*)':
imgui_impl_opengl3.cpp:148: undefined reference to `glGetIntegerv'
imgui_impl_opengl3.cpp:230: undefined reference to `glEnable'
imgui_impl_opengl3.cpp:231: undefined reference to `__glewBlendEquation'
all other glfw and opengl functions are working in my application.cpp it only breaks when i add imgui files to the project.