hi everyone,
im having a problem linking my project..(the classes are very simple)
it compiles fine..but just wont link...im using ms visual C++..and my classes are
parser.cpp
table.cpp
pguide.cpp (has main)
as well as some .h files..
the error message is:
Linking...
pguide.obj : error LNK2001: unresolved external symbol "public: __thiscall parser:arser(void)" (??0parser@@QAE@XZ)
Debug/pguide.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
pguide.exe - 2 error(s), 0 warning(s)
can someone please help...thanks (the classes are below and .h files are in the attachements)
---------
pguide.cpp
Code:
#include "parser.h"
#include "table.h"
int main(void) {
parser p;
p.readFile();
return 0;
}
----------------
table.cpp
Code:
#include "table.h"
table::table(void) {
cellLength=0;
noOfCells=0;
}
void table::printBar(void) {
}
-----------
parser.cpp
Code:
#include <fstream>
#include <string>
#include "parser.h"
using namespace std;
/* constructor */
parser::parser(void);
int parser::readFile(void) {
string filename;
string line;
cout << "File name: ";
cin >> filename;
ifstream file(filename.c_str());
if(!file.is_open()) {
cout << "Error...file is not opened" << endl;
return 0;
}
else
return 1;
while (!file.eof()) {
getline(file, line);
cout << line << endl;
}
file.close();
}