I am working a variation of the 'turtle' program.
I was given this code by the instructor, and I just want it to compile first, but I am getting these errors using Studio 08.
#########################################
Error 1 error LNK2019: unresolved external symbol "public: void __thiscall TurtleGraphics:rocessTurtleMoves(int const * const)" (?processTurtleMoves@TurtleGraphics@@QAEXQBH@Z) referenced in function _main Assign6.obj turtle
Error 2 error LNK2019: unresolved external symbol "public: __thiscall TurtleGraphics::TurtleGraphics(void)" (??0TurtleGraphics@@QAE@XZ) referenced in function _main Assign6.obj turtle
Error 3 fatal error LNK1120: 2 unresolved externals C:\Documents and Settings\a00774161\Desktop\turtle\turtle\Debug\tur tle.exe 1 turtle
##########################################
Code:
//Turtle.cpp
#include <iostream>
using namespace std;
#include "TurtleGraphics.h"
int main()
{
int cmds[] = {5,5,4,5,9,2,5,12, 1,}; // go to start of page and put pen down
TurtleGraphics turtleOne; // create a TurtleGraphics object
turtleOne.processTurtleMoves(cmds); // have turtle process commands
cout << "end of program\n\n"; // for testing purpose
system("pause");
return 0; // we are finished, let's go home
}
Code:
//TurtleGraphics.h
#pragma once
class TurtleGraphics
{
private:
const static int NROWS = 22;
const static int NCOLS = 70;
const static int STARTING_ROW = 0;
const static int STARTING_COL = 0;
const static int STARTING_DIRECTION = 6; //12 = up, 3 = right, 6 = down, 9 = left
const static bool STARTING_PEN_POSITION = false;
void displayFloor(); // will display floor on the screen
bool m_Floor [NROWS][NCOLS]; // floor on which turtle will draw
public:
TurtleGraphics(void); //ctor will init. floor to all "false" values,
void processTurtleMoves( const int commands[]);
};