How to fix "Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)"

17,643

Solution 1

It's quite an old question but I was looking for solution of the same issue and came here, so maybe my answer will help someone in future.

In Ubuntu 17.10 it was enough to install libglew-dev package to solve this

sudo apt install libglew-dev

Solution 2

Download The OpenGL Extension Wrangler Library and add include and lib path in cmake project file.

For example:

set(GLEW_INCLUDE_DIR, "/glew-2.0.0/include/")
set(GLEW_LIBRARY, "/glew-2.0.0/lib")

Hope this helps.

Share:
17,643
Admin
Author by

Admin

Updated on June 07, 2022

Comments

  • Admin
    Admin almost 2 years

    It appears you are building natively for Linux with GCC

    Cocos2dx on Linux : "cmake -G 'CodeBlocks - Unix Makefiles'
    -- OpenGL include dirs: /usr/include
    CMake Error at /usr/local/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
      Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)
    Call Stack (most recent call first):
      /usr/local/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
      /usr/local/share/cmake-3.4/Modules/FindGLEW.cmake:44 (find_package_handle_standard_args)
      cocos2d/cmake/Modules/CocosBuildHelpers.cmake:44 (find_package)
      cocos2d/CMakeLists.txt:190 (cocos_find_package)
    
    -- Configuring incomplete, errors occurred!
    See also "/home/daw/Dev/cocos2d-x-3.9/allProject/testC/CMakeFiles/CMakeOutput.log".
    
  • Roger Allen
    Roger Allen almost 5 years
    I had to remove the commas after the variable names.
  • gtx
    gtx over 4 years
    im still getting the error and i did all the steps listed above