Sign in to follow this  
neerajshastry

pls help me with this c++ error

Recommended Posts

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....

Share this post


Link to post
Share on other sites
neerajshastry, can you hear us?

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


*sigh*

Share this post


Link to post
Share on other sites
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;
}

Share this post


Link to post
Share on other sites
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?

!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this