If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

[RESOLVED] error LNK2019: unresolved external symbol???

I don't know why I'm getting this error, this is a post fix calculator for array use review, I'll include only the push functions to save post space. If i comment out the push/pops, the errors does not occur.

Re: error LNK2019: unresolved external symbol???

Compilable code:

Stack.h

Code:

int const MAX = 10; // The MAX number of elements for the stack
// MAX is unknown to the client
// MAX is to prevent double digit numbers.
typedef int el_t; // the el_t type is int for now
// el_t is unknown to the client
class stack
{
private: // to be hidden from the client
el_t el[MAX]; // el is an array of el_t's --int's
int top; // top is index to the top of stack
void stackError(char*); // utility function for error handling
public: // prototypes to be used by the client
stack(); // constructor
~stack(); // destructor to get rid of object
class Overflow{}; //exception to be thrown //"withing stack class"???
class Underflow{}; //exception to be thrown
// How to call: format stackname.push(argument)
// PURPOSE: if not full, enters an element at the top
void push(el_t);
// How to call: format stackname.push(pass by reference argument)
// PURPOSE: if not empty, removes and gives back the top element
void pop(el_t&); //Pass by reference, get element back as arg
// HOW TO CALL: stackname.push(pass by reference argument)
// PURPOSE: if not empty, gives the top element without removing it
void topElem(el_t&); //Pass by reference, get element back as arg
// How to call: stackname.isEmpty();
// PURPPOSE: returns true is stack is empty, else false
bool isEmpty();
// How to call: stackname.isFull();
// PURPPOSE: returns true if stack is full, else false
bool isFull();
// How to call: stackname.displayAll();
// PURPPOSE: display all elements in el_t, vertically. Non distructive.
void displayAll();
// How to call: stackname.clearIt();
// PURPPOSE: Clear the entire stack.
void clearIt();
};
// Note: semicolon is needed at the end of the header file

Re: error LNK2019: unresolved external symbol???

Originally Posted by ZuK

Compiles fine for me.
So my first statement holds. Did you add stack.cpp to the project ?
Kurt

resolved. Good call, ZuK, for turning my attention to Visual Studio.

I copied all the source files to the local folder after working on the project from a different location, on a thumb drive. I also changed the stack.cpp file name. Resolved by compiling stack.cpp before compiling client.