Undefined link to `glewInit @ 0 '

I am trying to connect glewwith my project in code::blocksby following these steps:

//1- copied all the header files(glew.h....) to C:\Program Files (x86)\CodeBlocks\MinGW\include and 
//the libs to C:\Program Files (x86)\CodeBlocks\MinGW\lib 


//2-added the libs to the compiler Build Options > Linker Settings > add (considered to add glew32s.lib at the top)


|undefined reference to `glewInit@0'|

not sure what is missing here!

+3
source share
2 answers

An old question that I know but had the same problem and finally found its problem.

I needed to link 'glew32s' to my project and have it FIRST on the list. in Code :: Blocks:

  • right click on the project and go to 'build options'
  • Go to the "Linker Settings" tab.
  • left click on the name of your project (do not debug or release)
  • click "add" and enter "glew32s" in the popup
  • glew32s ,

, , , .

+1

, .lib .

glew32.lib / .exe , , .lib , opengl32.lib.

main.cpp.

#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glew32.lib")
0

All Articles