Identifier not found

Hi, so I'm attempting to make a pong game through OpenGL and as I was following a guide (as i'm new to OpenGL and learning) to making a box and display a score, but for some reason when I try to run it to see if the score is working now, I'm getting two errors claiming two of my identifiers are not found, so naturally I thought this was my mistake because I was writing the code out myself rather than copy and pasting (I find it easier to remember code if I write it out) so I went back and copy and pasted what the tutorial wrote just to make sure it wasn't me but again still got the same issue.

Hopefully someone can see what I am doing wrong and where I have gone wrong.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
  // pong.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <string>
#include <windows.h>
#include <iostream>
#include <conio.h>
#include <sstream> 
#include <math.h> 
#include <gl\gl.h>
#include <gl\glu.h>
#include "GL/freeglut.h"
#pragma comment(lib, "OpenGL32.lib")


// window size and update rate (60 fps)
int width = 500;
int height = 200;
int interval = 1000 / 60;

// score
int score_left = 0;
int score_right = 0;


void draw() {
	// clear (has to be done at the beginning)
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	// TODO draw our scene

	// draw score
	drawText(width / 2 - 10, height - 15, int2str(score_left) + ":" + int2str(score_right));

	// swap buffers (has to be done at the end)
	glutSwapBuffers();
}

void drawText(float x, float y, std::string text) {
	glRasterPos2f(x, y);
	glutBitmapString(GLUT_BITMAP_8_BY_13, (const unsigned char*)text.c_str());
}

void update(int value) {
	// Call update() again in 'interval' milliseconds
	glutTimerFunc(interval, update, 0);

	// Redisplay frame
	glutPostRedisplay();
}

void enable2D(int width, int height) {
	glViewport(0, 0, width, height);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(0.0f, width, 0.0f, height, 0.0f, 1.0f);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}


std::string int2str(int x) {
	// converts int to string
	std::stringstream ss;
	ss << x;
	return ss.str();
}

// program entry point
int _tmain(int argc, char** argv) {
	// initialize opengl (via glut)
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
	glutInitWindowSize(width, height);
	glutCreateWindow("Nicky's Pong");

	// Register callback functions   
	glutDisplayFunc(draw);
	glutTimerFunc(interval, update, 0);

	// setup scene to 2d mode and set draw color to white
	enable2D(width, height);
	glColor3f(1.0f, 1.0f, 1.0f);

	// start the whole thing
	glutMainLoop();
	return 0;
}
I'm getting two errors claiming two of my identifiers are not found

Which ones? Or better yet, copy the compiler errors here so we can see them.
@booradley60 My apologies, I thought I added it, here is the errors

"Error 1 error C3861: 'drawText': identifier not found f:\documents\visual studio 2013\projects\pong\pong\pong.cpp 36

Error 2 error C3861: 'int2str': identifier not found f:\documents\visual studio 2013\projects\pong\pong\pong.cpp 36
"

https://gyazo.com/aa7226a96804fe930356ba8e44b1cd0f

also added in an image of it too.
In draw you are using the two functions mentioned here before any declaration or definition is found by the compiler. Either put declarations for drawText and int2str above draw or move the definitions themselves there.
@cire Ughhhh, I feel so stupid now, such an easy mistake to make :/, thank you for providing an answer quickly and effectively, much appreciated.
Topic archived. No new replies allowed.