473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Odd Error

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*
}
}
Jul 19 '05 #1
2 1878

"K" <kh******@stevens.edu> wrote in message
news:19**************************@posting.google.c om...
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)
You show the error messages, but not the code that
caused them. Where are the definitions of those
functions?
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 <iostream>
#include<iomanip.h>
#include <iomanip>
(You're not using anything from this header anyway.)
#include "Queue.h"
We need to see this file, and the file containing
the implementations of the member functions if they're
not defined inside the class definition, and the
static members (if any).

using namespace std;
struct process {
int burstTime;
int priority;
}one, two, three, four, five;

void main()
int 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);
Where is the definition of function 'Queue::enqueuefront()' ?
order.enqueuefront(two.burstTime);
order.enqueuefront(three.burstTime);
order.enqueuefront(four.burstTime);
order.enqueuefront(five.burstTime);

do
{
int tmp;
tmp = order.getFront();
Where is the definition of function 'Queue::getFront()' ?
order.dequeueback();
Where is the definition of function 'Queue::dequeueback()' ?

cout << "P1 ";
for(int x; x <= tmp; x++)
'x' has not been initialized or assigned a value. Both
of the expressions 'x <= tmp' and 'x++' evaluate an
uninitialized object. Undefined behavior.
{
cout << "__";
}
cout << "\n";
}while(order.isEmpty());//continue while order is not empty*
Where is the definition of function 'Queue::isEmpty()' ? }
}


Looks like you forgot to provide the compiled Queue.cpp
to the linker.

-Mike
Jul 19 '05 #2


K wrote:

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.


But this time you forgot to add Queue.cpp to your project.
Or you did add a file Queue.cpp, but it does not contain
the above mentioned functions.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
2
by: Gregory | last post by:
Hi, One of the disadvantages of using error handling with error codes instead of exception handling is that error codes retuned from a function can be forgotten to check thus leading to...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
1
by: developer | last post by:
Hi All I have made a .NET project. the files included are borland c++ files that i am migrate to VC++ .NET I am using Microsoft Visual C++ .NET 2003. the compilation goes through properly,...
0
by: mchuc7719 | last post by:
Hello, I have a Vb.Net 2005 ClassLibrary, when I try to compile using MSBee, only get errors. Before I to run the command line, I open in notepad the .vbproj and I was add the next line: ...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.