Jump to content
  • Advertisement
Sign in to follow this  
neerajshastry

pls help me with this c++ error

This topic is 3259 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!