Order of the Butterfly
Posts: 358 from 2003/10/3
From: Padova - Italy
I have a little stupid problem using gcc under MOS SDK in c++ mode.
Here a piece of the file:
-----------------------------------------------------
include <iostream.h>
// simple oo example
class animal {
int legs; // private
public:
animal(void); // costruttore
~animal(void); // distruttore
void animal::putlegs(int legs); // prototipi
void animal::putlegs(void); // polimorfismo...
int animal::readlegs(void);
};
animal::animal(void) {
cout << "Amimal initialized\n";
legs=0;
}
... and so on...
------------------------------------------------------
The OO part seems to be complied OK but I get this nasty error message
if I try to use cin/cout functions:
/t/ccjnK8bm.o: In function `animal::animal(void)':
/t/ccjnK8bm.o(.text+0x22): undefined reference to `cout'
/t/ccjnK8bm.o(.text+0x26): undefined reference to `cout'
/t/ccjnK8bm.o(.text+0x30): undefined reference to `ostream::operator<<(char const *)'
collect2: ld returned 1 exit status
What I'm doing wrong? Why I am not able to use cin/cout functions??
Thanx 4 replying this stupid question but I'd really like to learn c++!!
P.S.:Ah, I'm forgetting this little piece of code is inspired by the little
Fabio Ciucci's(aka Randy/Ram Jam in the good 90's Amiga years) c++ course.
Thanx RJ!!
-------------------