Answer the question
In order to leave comments, you need to log in
How to connect glad to a project in qt creator?
Good afternoon. I'm trying to start learning opengl, but not yet. I need to include the glad ( ) library in a qt creator project. This library consists of a couple of headers and one .c file.
All my attempts lead to errors like
:-1: error: glad.o: undefined reference to symbol '[email protected]@GLIBC_2.2.5'or
error: undefined reference to `gladLoadGLLoader'(gladLoadGLLoader is the glad function). It seems to me that the compiler does not see the implementation of the header files, but this is not certain. I work on manjaro linux.
Answer the question
In order to leave comments, you need to log in
Solution: Here is my CMakeLists
cmake_minimum_required(VERSION 3.5)
project(untitl LANGUAGES CXX C)
add_executable(untitl main.cpp glad.c)
find_package(glfw3 3.3 REQUIRED)
find_package(OpenGL REQUIRED)
target_include_directories(untitl PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(untitl PUBLIC glfw OpenGL::GL ${CMAKE_DL_LIBS})
project(untitl LANGUAGES CXX C)
You need to add a link with the libdl library
https://stackoverflow.com/questions/56841870/how-t...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question