pls help me with this c++ error

Started by
7 comments, last by Zahlman 14 years, 10 months ago
I wrote a program in vc++ 2008 and i am getting the following error: 1>Linking... 1>overloading -.obj : error LNK2019: unresolved external symbol "public: void __thiscall space::display(void)" (?display@space@@QAEXXZ) referenced in function _main 1>G:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\overloading\Debug\overloading.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://g:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\overloading\overloading\Debug\BuildLog.htm" how do i solve it.....pls tell its urgent....
Advertisement
You've added a function to the class 'space' named 'display'... but you didn't implement the function in a CPP file?
neerajshastry, can you hear us?

Quote:MikeTacular
neerajshastry, do you ever google your questions before you ask them? Because you should. Always.


*sigh*
ya I did google the question but still didnt get the appropriate answer......
here is the code for reference

#include <iostream>

using namespace std;

class space
{
int x;
int y;
int z;

public:
void getdata(int a,int b,int c);
void display(void);
void operator-();

};
void space ::getdata(int a, int b, int c)
{
x = a;
y = b;
z = c;
}

void space ::operator -()
{
x = -x;
y = -y;
z = -z;
}

int main()
{
space S;
S.getdata(10,-20,30);

cout << "S : ";
S.display();
return 0;
}
Quote:Original post by Hodgman
You've added a function to the class 'space' named 'display'... but you didn't implement the function in a CPP file?

!
thanks Dragon0 i got my problem solved
Quote:Original post by neerajshastry
thanks Dragon0 i got my problem solved


See, you don't even read all posts, do you? Hodgman was the one giving you an answer, and Dragon0 emphasized it.

And I don't believe you that you have tried google yet. Because, I get tons of proper solutions: teh googles, they do nuzzing.


edit: Oh, and if you ever post code again, then you might want to use proper tags. Posting code as plain text is often regarded impolite on every programming forum: gd.net supported tags and text formatting.
Quote:Original post by neerajshastry
ya I did google the question but still didnt get the appropriate answer......


Funny, because when I try it, I see many results, mostly coming from people asking similar questions on other forums - and getting answers.

This topic is closed to new replies.

Advertisement