Problem linking openGL dev libraries

I’m having trouble getting libopengl32.a to link into my program.
The compiler is finding the library and it’s not a c linkage problem afaik.

Here’s the compiler output:

d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:42: undefined reference to glCreateProgram@0' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:45: undefined reference toglCreateShader@4’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:54: undefined reference to glShaderSource@16' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:57: undefined reference toglCompileShader@4’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:61: undefined reference to glGetShaderiv@12' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:65: undefined reference toglAttachShader@8’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:68: undefined reference to glCreateShader@4' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:77: undefined reference toglShaderSource@16’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:80: undefined reference to glCompileShader@4' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:84: undefined reference toglGetShaderiv@12’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:88: undefined reference to glAttachShader@8' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:91: undefined reference toglLinkProgram@4’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:95: undefined reference to glGetProgramiv@12' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:99: undefined reference toglGetAttribLocation@8’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:112: undefined reference to glGenBuffers@8' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:113: undefined reference toglBindBuffer@8’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:114: undefined reference to glBufferData@16' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:117: undefined reference toglGenBuffers@8’
d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:118: undefined reference to glBindBuffer@8' d:/my_projects/cubic_mahjong/working/source/main/c++/opengl.cpp:119: undefined reference toglBufferData@16’

Thanks in advance for any help. Greatly appreciated.
Clarrie.

Because you’re running on Windows, you need to use an extension loader like GLEW to query and provide the OpenGL function pointers:

[ul]
[li]https://www.gamedev.net/forums/topic/637289-opengl-shaders-in-windows/
[/li][li]https://stackoverflow.com/questions/19948497/why-does-mingw-give-an-undefined-reference-to-gluseprogram
[/li][/ul]