|
-
Jun 22nd, 2002, 02:05 AM
#1
Thread Starter
Banned
Unresolved External Error
--------------------Configuration: Horses - Win32 Debug--------------------
Linking...
Horses.obj : error LNK2001: unresolved external symbol "void __cdecl dispStat(class ofstream,class ifstream,class apvector<int>)" (?dispStat@@YAXVofstream@@Vifstream@@V?$apvector@H@@@Z)
Debug/Horses.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Horses.exe - 2 error(s), 0 warning(s)
----------------------------------------------------------------------------------------
It compiles but does not build
#include "stdafx.h"
#include <apvector.h>
#include <fstream.h>
void dataFile(ofstream write, ifstream read, apvector<int> stats);
void dispStat(ofstream write, ifstream read, apvector<int> stats);
void main()
{
ofstream write;
ifstream read;
apvector<int> stats;
int choice;
dataFile(write,read,stats);
cout<<"< Menu > "<<endl<<endl;
cout<<"1. Reset Horse Statistics"<<endl;
cout<<"2. View Horse Statistics"<<endl;
cout<<"3. Hit the track"<<endl<<endl;
cout<<"\t. ";
cin>>choice;
switch (choice)
{
case 1 : break;
case 2 : dispStat(write,read,stats);
case 3 : break;
default : cout<<endl<<endl<<"\t.Please enter a correct choice."<<endl<<endl;
}
dispStat(write,read,stats);
}
void dataFile(ofstream write, ifstream read, apvector<int> stats)
{
read.open("stats.dat");
read>>stats[0];
read.close();
if (stats[0]==0)
{
write.open("stats.dat");
for (int x=0;x<8;x++)
write<<"0 ";
write.close();
}
}
void dispStats(ofstream write, ifstream read, apvector<int> stats)
{
read.open("stats.dat");
for (int x=0;x<stats.length()-1;x++)
{
stats.resize(stats.length()+1);
read>>stats[x];
}
read.close();
for (x=0;x<stats.length()-1;x++)
cout<<stats[x]<<" ";
}
Last edited by C Penis Plus; Jun 22nd, 2002 at 03:47 AM.
-
Jun 22nd, 2002, 09:33 AM
#2
Frenzied Member
add apvector.h to the project...and leave #include<apvector.h>
-
Jun 22nd, 2002, 09:28 PM
#3
Thread Starter
Banned
What do you mean "add" it to the project, and how would I do that? Thanks.
-
Jun 22nd, 2002, 09:41 PM
#4
Hyperactive Member
I believe he means to add it to the program as you would a .cpp file.
Now returning to the world of VB. Please make sure your seatbelts are securely fastened and all trays are in their upright and locked position.
-
Jun 23rd, 2002, 12:06 AM
#5
Thread Starter
Banned
Yeah I added it, but I still get the error.
-
Jun 23rd, 2002, 06:15 AM
#6
Frenzied Member
same one? 
by the way: just in case. if you're using VC++, adding to a project: menu: Project > Add To Project > Files (apvector.h is in the include folder)
-
Jul 9th, 2002, 02:28 AM
#7
Spelling error: your prototype says appStat, the function is called appStats!
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|