Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: A simple C+...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 9306 of 10094
Post > Topic >>

Re: A simple C++ program

by Thomas Richter <thor@[EMAIL PROTECTED] > Feb 23, 2008 at 10:45 AM

xiao schrieb:
> #include <string>
> #include <iostream>
> using namespace std;
> class HowEasy
> {
> public:
> 	HowEasy();  <---- declaration of the constructor.
> 	int pointVal(string param0);
> };

> void main()
> {
>    string test="a simple test";
>    HowEasy easy;
>    int returnvalue;
>    returnvalue=easy.pointVal(test);
> }
> 
> When I compile the program using visual studio 2005, I got the
> following result
> test.obj : error LNK2019: unresolved external symbol "public:
> __thiscall HowEasy::HowEasy(void)" (??0HowEasy@[EMAIL PROTECTED]
) referenced in
> function _main
> 
> Can somebody tell me why this program can not work?Thanks.

Because you declared the constructor (see above), but never defined it.

Greetings,
	Thomas



-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 1 Posts in Topic:
Re: A simple C++ program
Thomas Richter <thor@[  2008-02-23 10:45:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 18:27:17 CDT 2008.