OPENGL报错

报错1:

/usr/bin/ld: CMakeFiles/openglDisplay.dir/src/glad.c.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
原因:(之前丢了 dl ${EXTRA_LIBS} )
解决办法:
SET(EXTRA_LIBS  dl ${EXTRA_LIBS}  glfw ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${FREETYPE_LIBRARIES})

报错2:

对‘FT_Init_FreeType’未定义的引用

忘记link_libraries(${FREETYPE_LIBRARIES})了
改为
find_package(Freetype REQUIRED)
include_directories(${FREETYPE_INCLUDE_DIR})
include_directories(${FREETYPE_INCLUDE_DIR_ft2build})
link_libraries(${FREETYPE_LIBRARIES})

你可能感兴趣的:(opengl)