# glew and code::Blocks 10.5 issue

## Recommended Posts

hello am having issues with trying to use glew i have added the linker flags like so

-lmingw32 -lSDLmain -lglew32 -lglew32s -lSDL -lSDL_image -lopengl32

iv included my glew include folder

iv included my glew lib folder

and iv included the glew32s.lib file

iv also done #define GLEW_STATIC

and glewInit

none of which worked

i downloaded from the glew website the binary version is there something wrong with it or am i missing something??

im using code::Blocks 10.5 and mingw

it wont compile when i do all those things above in code::Blocks 10.5

heres my compiler errors

undefined reference to _imp____glewCreateShader'|
obj\Debug\main.o||In function SDL_main':|
undefined reference to _imp__glewInit'|

##### Share on other sites
You need glew compiled for mingw- I'll grab a link. If I can't find one I'll post one.

##### Share on other sites
got glew working acording to my error check but it compiles returning 3 its something to do with sdl and i cant quite get my head on it

##### Share on other sites
[quote name='PGSCreativeDirector' timestamp='1318872383' post='4873540']
hello am having issues with trying to use glew i have added the linker flags like so

-lmingw32 -lSDLmain -lglew32 -lglew32s -lSDL -lSDL_image -lopengl32

iv included my glew include folder

iv included my glew lib folder

and iv included the glew32s.lib file

iv also done #define GLEW_STATIC

and glewInit

none of which worked

i downloaded from the glew website the binary version is there something wrong with it or am i missing something??

im using code::Blocks 10.5 and mingw

it wont compile when i do all those things above in code::Blocks 10.5

heres my compiler errors

obj\Debug\main.o||In function SDL_main':|
undefined reference to _imp__glewInit'|

[/quote]
Linker errors I see. With Mingw, the linking order matters. I know from my own projects, GLEW likes to come first or it won't link. Try putting it in front of SDL main. If that doesn't work, move it to the front and try mingw32 in other places. After some experimenting, I can usually find a permutation that works.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628277
• Total Posts
2981770

• 10
• 11
• 17
• 10
• 9