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

3

14

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".
Panarabism answered 11/12, 2015 at 19:11 Comment(1)
make sure you have installed all the dependencies listed in cocos2d-x.org/wiki/Linux_Installation_and_SetupCharlie
S
21

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
Sedgewick answered 9/3, 2018 at 18:57 Comment(0)
G
8

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.

Gluey answered 22/11, 2016 at 13:8 Comment(2)
I had to remove the commas after the variable names.Saintpierre
im still getting the error and i did all the steps listed abovePiggin
C
1

list(APPEND CMAKE_PREFIX_PATH "path/to/glew")

add this in the relevant CMakeLists.txt

for details see this link https://itecnote.com/tecnote/cmake-cant-find-glew/

Chancemedley answered 7/1 at 16:4 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Unmannerly

© 2022 - 2024 — McMap. All rights reserved.