skyice
12-11-2000, 11:23 AM
I'm trying to compile a test c file under gcc with red hat 7 using "gcc test.cpp". Everything goes fine until I try to access a function in iostream.h.
Here's test.cpp:
#include <iostream.h>
int main()
{
cout << "hi\n";
return 0;
}
here's the errors I get:
/tmp/ccEfU66W.o: In function `main':
/tmp/ccEfU66W.o(.test+0xf): undefined reference to `cout'
/tmp/ccEfU66W.o undefined reference to `ostream: http://www.linuxnewbie.org/ubb/redface.gifperator<<(char const *)'
collect2: ld returned 1 exit status
any help would be appreciated.
Here's test.cpp:
#include <iostream.h>
int main()
{
cout << "hi\n";
return 0;
}
here's the errors I get:
/tmp/ccEfU66W.o: In function `main':
/tmp/ccEfU66W.o(.test+0xf): undefined reference to `cout'
/tmp/ccEfU66W.o undefined reference to `ostream: http://www.linuxnewbie.org/ubb/redface.gifperator<<(char const *)'
collect2: ld returned 1 exit status
any help would be appreciated.