Newbie problem with the String class

Eric Rouse eric at brew-meister.com
Thu Feb 10 01:50:02 GMT 2000


Ok, here ya go...


#include <iostream>
#include <string>

using namespace std;

int main ()
{
   string s("Hello World");

   cout << s << endl;
	
   return 0;
}


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 2/9/00, 6:51:55 AM, Martin Wiebusch <marwie at gmx.net> wrote regarding 
Re: Newbie problem with the String class:


> Eric Rouse wrote:
> > Try this instead then work on String - note standard library headers
> > don't have the .h and also make sure your using the new gcc compiler
> > (2.95.2 - www.gcc.org) if you want to use exceptions...
> >
> >
> > #include <iostream>
> > using namespace std;
> >
> > int main ()
> > {
> >     cout << "Hello, World." << endl;
> >     return 0;
> > }
> >
> >
> > Regards,
> > Eric

> Ok, this works, but anyway, I can't create any instances of the String
> class. I tried this:

>  #include <iostream>
>  #include <String>

>  int main ()
>  {
>      String s = "Hello world";
>      return 0;
>  }

> Building the project again produced said error messages:

> > undefined reference to 'String::String(char const *)'
> > undefined reference to 'String::~String(void)'
> > undefined reference to 'String::~String(void)'

> Any idea?







More information about the KDevelop mailing list