Hi there,
this is really getting on my nerves now - I've been trying for hours to get some code working that I have been learning from, but whenever I try to compile my code, all I get is the error "error LNK2001: unresolved external symbol". I've had many different errors for the vast amount of solutions that I have tried:
I have set the linker to "Windows /SUBSYSTEM:WINDOWS", as my application is a windows Application.
I'm pretty sure I selected the correct project type.
#include <Windows.h>
#include <gl/GL.h>
#include <gl/GLU.h>
#include <gl/GLAUX.H>
#pragma comment(linker, "/SUBSYSTEM:WINDOWS")
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();
glBegin(GL_POLYGON);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(0.0f, 0.0f, -1.0f);
glVertex3f(-1.0f, 0.0f, -1.0f);
glVertex3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.0f, -1.0f, 0.0f);
glVertex3f(0.0f, -1.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(0.0f, -1.0f, 0.0f);
glVertex3f(0.0f, -1.0f, -1.0f);
glVertex3f(0.0f, 0.0f, -1.0f);
glVertex3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.0f, 0.0f, -1.0f);
glVertex3f(-1.0f, -1.0f, -1.0f);
glVertex3f(-1.0f, -1.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(0.0f, -1.0f, -1.0f);
glVertex3f(-1.0f, -1.0f, -1.0f);
glVertex3f(-1.0f, -1.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(-1.0f, 0.0f, -1.0f);
glVertex3f(-1.0f, -1.0f, -1.0f);
glVertex3f(0.0f, -1.0f, -1.0f);
glEnd();
glPopMatrix();
}
void DrawArm(float xPos, float yPos, float zPos)
{
glPushMatrix();
glColor3f(1.0f, 0.0f, 0.0f);
glTranslatef(xPos, yPos, zPos);
glScalef(1.0f, 4.0f, 1.0f);
DrawCube(0.0f, 0.0f, 0.0f);
glPopMatrix();
}
void DrawHead(float xPos, float yPos, float zPos)
{
glPushMatrix();
glColor3f(1.0f, 1.0f, 1.0f);
glTranslatef(xPos, yPos, zPos);
glScalef(2.0f, 2.0f, 2.0f);
DrawCube(0.0f, 0.0f, 0.0f);
glPopMatrix();
}
void DrawTorso(float xPos, float yPos, float zPos)
{
glPopMatrix();
glColor3f(0.0f, 0.0f, 0.0f);
glTranslatef(xPos, yPos, zPos);
glScalef(3.0f, 5.0f, 1.0f);
DrawCube(0.0f, 0.0f, 0.0f);
glPopMatrix();
}
void DrawLeg(float xPos, float yPos, float zPos)
{
glPushMatrix();
glColor3f(1.0f, 1.0f, 0.0f);
glTranslatef(xPos, yPos, zPos);
glScalef(1.0f, 5.0f, 1.0f);
DrawCube(0.0f, 0.0f, 0.0f);
}
void DrawRobot(float xPos, float yPos, float zPos)
{
static bool leg1 = true;
static bool leg2 = false;
static bool arm1 = true;
static bool arm2 = false;
glPushMatrix();
glTranslatef(xPos, yPos, zPos);
DrawHead(1.0f, 2.0f, 0.0f);
DrawTorso(1.5, 0.0, 0.0f);
glPushMatrix();
}
I am well and truly stuck, and any help would be great.
Thanks all,
Nick