K
K
I'm fairly new to c++ and have been getting the following error when I
try to execute my script (I dont get any error after compiling
though).
Error:
hw3_v1.obj : error LNK2001: unresolved external symbol "public:
__thiscall Queue::~Queue(void)" (??1Queue@@QAE@XZ)
hw3_v1.obj : error LNK2001: unresolved external symbol "public: bool
__thiscall Queue::isEmpty(void)const " (?isEmpty@Queue@@QBE_NXZ)
hw3_v1.obj : error LNK2001: unresolved external symbol "public: void
__thiscall Queue::dequeueback(void)" (?dequeueback@Queue@@QAEXXZ)
hw3_v1.obj : error LNK2001: unresolved external symbol "public: char
__thiscall Queue::getFront(void)const " (?getFront@Queue@@QBEDXZ)
hw3_v1.obj : error LNK2001: unresolved external symbol "public: void
__thiscall Queue::enqueuefront(char)" (?enqueuefront@Queue@@QAEXD@Z)
hw3_v1.obj : error LNK2001: unresolved external symbol "public:
__thiscall Queue::Queue(void)" (??0Queue@@QAE@XZ)
Not sure why it is doing this. I've used this Queue.h and Queue.cpp on
other programs that function fine.
Here is the code I'm writing:
#include<iostream.h>
#include<iomanip.h>
#include "Queue.h"
struct process {
int burstTime;
int priority;
}one, two, three, four, five;
void main()
{
int selection;
one.burstTime = 10;
one.priority = 3;
two.burstTime = 1;
two.priority = 1;
three.burstTime = 2;
three.priority = 3;
four.burstTime = 1;
four.priority = 4;
five.burstTime = 5;
five.priority = 2;
cout << "Select a Scheduling Technique:\n";
cout << "1 - FCFS\n";
cout << "2 - SJF\n";
cout << "3 - Priority\n";
cout << "4 - RR\n";
cin >> selection;
if(selection == 1)
{
Queue order;
//load up the queue since we know that is is first come first serve
and we know
//the order
order.enqueuefront(3);
order.enqueuefront(two.burstTime);
order.enqueuefront(three.burstTime);
order.enqueuefront(four.burstTime);
order.enqueuefront(five.burstTime);
do
{
int tmp;
tmp = order.getFront();
order.dequeueback();
cout << "P1 ";
for(int x; x <= tmp; x++)
{
cout << "__";
}
cout << "\n";
}while(order.isEmpty());//continue while order is not empty*
}
}
try to execute my script (I dont get any error after compiling
though).
Error:
hw3_v1.obj : error LNK2001: unresolved external symbol "public:
__thiscall Queue::~Queue(void)" (??1Queue@@QAE@XZ)
hw3_v1.obj : error LNK2001: unresolved external symbol "public: bool
__thiscall Queue::isEmpty(void)const " (?isEmpty@Queue@@QBE_NXZ)
hw3_v1.obj : error LNK2001: unresolved external symbol "public: void
__thiscall Queue::dequeueback(void)" (?dequeueback@Queue@@QAEXXZ)
hw3_v1.obj : error LNK2001: unresolved external symbol "public: char
__thiscall Queue::getFront(void)const " (?getFront@Queue@@QBEDXZ)
hw3_v1.obj : error LNK2001: unresolved external symbol "public: void
__thiscall Queue::enqueuefront(char)" (?enqueuefront@Queue@@QAEXD@Z)
hw3_v1.obj : error LNK2001: unresolved external symbol "public:
__thiscall Queue::Queue(void)" (??0Queue@@QAE@XZ)
Not sure why it is doing this. I've used this Queue.h and Queue.cpp on
other programs that function fine.
Here is the code I'm writing:
#include<iostream.h>
#include<iomanip.h>
#include "Queue.h"
struct process {
int burstTime;
int priority;
}one, two, three, four, five;
void main()
{
int selection;
one.burstTime = 10;
one.priority = 3;
two.burstTime = 1;
two.priority = 1;
three.burstTime = 2;
three.priority = 3;
four.burstTime = 1;
four.priority = 4;
five.burstTime = 5;
five.priority = 2;
cout << "Select a Scheduling Technique:\n";
cout << "1 - FCFS\n";
cout << "2 - SJF\n";
cout << "3 - Priority\n";
cout << "4 - RR\n";
cin >> selection;
if(selection == 1)
{
Queue order;
//load up the queue since we know that is is first come first serve
and we know
//the order
order.enqueuefront(3);
order.enqueuefront(two.burstTime);
order.enqueuefront(three.burstTime);
order.enqueuefront(four.burstTime);
order.enqueuefront(five.burstTime);
do
{
int tmp;
tmp = order.getFront();
order.dequeueback();
cout << "P1 ";
for(int x; x <= tmp; x++)
{
cout << "__";
}
cout << "\n";
}while(order.isEmpty());//continue while order is not empty*
}
}