linosch
03-07-2002, 15:25
Hallo zusammen,
ich bin dabei mir C++ zu lernen. Als System benutze ich SuSE 8.0.
Mein Code:
#include <iostream>
using namespace std;
void main()
{
cout << "Hallo Welt!\n";
}
Wenn ich diesen mit cc test.cc -o test compiliere bekomme ich folgenden Fehler:
/tmp/ccxY7Wli.o: In function `main':
/tmp/ccxY7Wli.o(.text+0xf): undefined reference to `cout'
/tmp/ccxY7Wli.o(.text+0x14): undefined reference to `ostream::operator<<(char const *)'
collect2: ld returned 1 exit status
Nehme ich den Befehl cout heraus, also eine leere Main-Funktion, dann habe ich ein executable welches aber ja nichts tut.
Was mache ich denn falsch?
THX
Lino
ich bin dabei mir C++ zu lernen. Als System benutze ich SuSE 8.0.
Mein Code:
#include <iostream>
using namespace std;
void main()
{
cout << "Hallo Welt!\n";
}
Wenn ich diesen mit cc test.cc -o test compiliere bekomme ich folgenden Fehler:
/tmp/ccxY7Wli.o: In function `main':
/tmp/ccxY7Wli.o(.text+0xf): undefined reference to `cout'
/tmp/ccxY7Wli.o(.text+0x14): undefined reference to `ostream::operator<<(char const *)'
collect2: ld returned 1 exit status
Nehme ich den Befehl cout heraus, also eine leere Main-Funktion, dann habe ich ein executable welches aber ja nichts tut.
Was mache ich denn falsch?
THX
Lino