Hi,
I've been trying some OOP and despite cutting the code right down to skeleton, I'm still receiving the same error.
This is my header file:
Code:class Shape { public: Shape (int l=0, int h=0); private: int length; int height; protected: };
And this is main.cpp:
I'm using Visual Studio 2005 and this is the full error being reported, find it a little hard to understand:Code:#include <iostream> #include "vessel.h" using namespace std; int main() { int x; int y; cout << "enter the heighe" << endl; cin >> x; cout << "enter he length" << endl; cin >> y; Shape square(x,y); system ("PAUSE"); return 0; }
Unfortunately after removing a lot of the code and being this with left, as I mention the same error is still occurring.Code:------ Build started: Project: my project, Configuration: Debug Win32 ------ Compiling... main.cpp Linking... main.obj : error LNK2019: unresolved external symbol "public: __thiscall Shape::Shape(int,int)" (??0Shape@@QAE@HH@Z) referenced in function _main C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\my project\Debug\my project.exe : fatal error LNK1120: 1 unresolved externals Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\my project\my project\Debug\BuildLog.htm" my project - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Really appreciate it if someone could tell me what I'm doing wrong.
Thanks very much![]()



LinkBack URL
About LinkBacks




