Undefined reference - glPushMatrix()

Need help! As a new guy for C++ programming, I found the problem of undefined reference of glPushMatrix(), part of it as below. Can it be fixed, as I working OpenGL at Code::Blocks on Window Vista?

==============================================================

#pragma comment(linker, “/subsystem:windows”)

#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>

HDC g_HDC;
float angle = 0.0f;
float legAngle[2] = {0.0f, 0.0f};
float armAngle[2] = {0.0f, 0.0f};
bool fullScreen = false;

void DrawCube(float xPos, float yPos, float zPos)
{
glPushMatrix();

Undefined references is a linker message, means you miss a library.
In the project linker options add the library GL (or opengl32).

Thanks for your prompt input. How can I get that library ?

I tried to link opengl32.a. The error of "Undefined reference - glPushMatrix() " was cancelled, but the error was switched to “Undefined reference to gluPerspectiv@32”. Need any further input. Tks.

looks like you need to link to glu32.lib

http://www.opengl.org/resources/faq/technical/gettingstarted.htm
look at section 2.060

Ooh! Thanks a lot! I made it. Great Tks.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.