How to install glew on Codeblocks!
Steps:
1. Download Glew from the internet or from
here! (this is win32 version working for all the IDE);
2. Extract it with Winrar!
3. Link it to Codeblocks:
- Open the Codeblocks
After you did that, go to Setting -> Compiler -> Search Directories -> Compiler -> Click ADD -> and Browse for the Extracted Glew Directory/include
Example:
C:\Users\Black2\Desktop\glew-1.6.0\include
- after you select the include directory, click ok.
After you did that, go to Setting -> Compiler -> Search Directories -> Linker -> Click ADD -> and Browse for the Extracted Glew Directory/lib
Example:
C:\Users\Black2\Desktop\glew-1.6.0\lib
-after you select the lib directory, click ok.
After you did that, go to Settings -> Compiler -> Linker Settings -> Link Libraries -> Browse for the Extracted Glew Directory/lib
Example:
C:\Users\Black2\Desktop\glew-1.6.0\lib
- select all the files in there, and then click OK button.
4. Before including glew.h to your source code, be sure you #define GLEW_STATIC
- when you include glew.h you would have to do it as follows:
#define GLEW_STATIC
#include <GL/glew.h>
5. Be sure you copy the content of Extracted Glew Directory/bin in the same place where your executable file is. In order to avoid getting the error glew.dll not found, etc.
Compilation errors:
- if you fail to link glew corectly you will receive compilations errors as follows:
undefined reference to 'glewInit@0'
undefined referece to 'glewInit'
glew.h "No such file in the directory"
undefined reference to '_imp_glewInit()'
etc
Runtime errors:
- if you fail putting the dll files corectly, or if you put another version glew.dll, into your executable folder, you will receive an error as follows:
or
- in order to fix this error you have to install the right glew.dll into your computer, either in WINDOWS/System32 or in the same file with your created executable file.