Sean
2010-02-25 13:44:24 UTC
Whatever is wrong cause's 9 issues when run:
1>Generating Code...
1>Compiling...
1>main.cpp
1>Linking...
1>fOp.obj : error LNK2019: unresolved external symbol "public: void __thiscall stack
1>fOp.obj : error LNK2019: unresolved external symbol "public: float __thiscall stack
1>fOp.obj : error LNK2019: unresolved external symbol "public: char __thiscall stack
etc....
~~~~~~~here is my stack class..
template
class stack
{
public:
stack(int);
~stack(void);
T pop(void);
void push(T);
bool isEmpty();
T peek();
private:
T *mem;
int max;
int top;
};
~~~~~Here is the class w/function that calls stack
class fOp
{
public:
bool endit;
fOp(void);
~fOp(void);
//gets filename
void getname(void);
//gets all equations from file, stores in linked list (elist)
void nwInfx(void);
//converts infix to postfix
void swtchfx(void); <--------------creates stack: 1 char, 1 float; also is link error
//decides operator importance
int work(char);
//adds values
float compute(float,float,int);
//displays elist
void show();
//control
elist * cursor;
private:
//gets filename
std::string fname;
//used to open file
char *name;
//flag
int txt;
//store infix equation
char infix[30];
//store postfix
char postfx[30];
//stores list of all equations in file
elist * head;
elist * tail;
};
~~~~~~Here is the switchfx() function with the issue......
void fOp::swtchfx(void)
{
//hold equation
char line[30];
//check operator importance
int A;
int B;
//computing
float fa;
float fb;
float fc;
//iterator
int i;
int j;
//max num in stack=16
stack
//max char in stack=15
stack
//reset cursor
cursor=head;
while(cursor!=NULL)
{
//default
memset(line,'\0',30);
i=0;
//set line= to infix
strcpy(line,cursor->getinfx());
for(i=0;line[i]!='\0';i++)
{
if(std::isdigit(line[i]))
numstk.push(line[i]);
else if(line[i]=='(')
{
//substack does inside parenth
stack
for(j=i+1;line[j]!=')';j++)
{
if(!opstk.isEmpty())
{
A=work(opstk.peek());
B=work(line[j]);
//compute using a then push b; else push b
if(A>=B||A==3 &&B==4)
{
if(A==5)
fa=fb=numstk.pop();
else
{
fb=numstk.pop();
fa=numstk.pop();
}
fc=compute(fa,fb,A);
numstk.push(fc);
}
}
opstk.push(line[j]);
}
i+=j;
//tmpstk.~stack();
}
else
{
//if empty push;else decide
if(!opstk.isEmpty())
{
A=work(opstk.peek());
B=work(line[i]);
//compute using a then push b; else push b
if(A>=B||A==3 &&B==4)
{
if(A==5)
fa=fb=numstk.pop();
else
{
fb=numstk.pop();
fa=numstk.pop();
}
fc=compute(fa,fb,A);
numstk.push(fc);
}
}
opstk.push(line[i]);
}
}//for(equation)
}//while cursor!=NULLL
}//function
##### So i have no idea how to go about resolving the link error, thanks in advance for trying to help..