Newbie problem with the String class
Eric Rouse
eric at brew-meister.com
Wed Feb 9 01:36:47 GMT 2000
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
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 2/8/00, 5:12:34 PM, Martin Wiebusch <marwie at gmx.net> wrote regarding
Newbie problem with the String class:
> Hi, I'm new to KDevelop. I was trying to write a simple C++ program
> (that "Hello world" stuff). It looks like that:
> #include <iostream.h>
> #include <stdlib.h>
> #include <String.h>
> int main(int argc, char** argv)
> {
> String s = "Hello world";
> cout << s << endl;
> return EXIT_SUCCESS;
> }
> Now, when I select "Compile file" everything works fine, but when I
> select "Make" or "Rebuild all" I get following error messages:
> undefined reference to 'String::String(char const *)'
> undefined reference to 'String::~String(void)'
> undefined reference to 'String::~String(void)'
> (Yes, I get the last one twice) There ist a file "String.h" in the
> directory /usr/include/g++/ and in that file the String class and the
> above mentioned constructor and destructor are defined.
> Has anyone an idea of what's going wrong there?
More information about the KDevelop
mailing list