c++ - Problems with iostream.h (bugs?)
- Alexis Golzman (23/25) Dec 25 2001 Hi, I'm trying to compile this little program:
- Walter (6/31) Dec 25 2001 The problem is -Ju. -Ju is for old K&R C programs, it causes char
- Alexis Golzman (5/5) Dec 26 2001 Now I changed the option to -J (chars are unsigned) and it works OK.
Hi, I'm trying to compile this little program: #include <iostream.h> void main() { cout << "Hello World!\n"; } But I get the following errors: sc test.cpp -cpp -Ae -Ju -ms -o+time -3 -a2 -c -I. -otest.obj Error: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(443): 'istream::getline' is already defined Error: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(452): 'istream::get' is already defined Error: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(468): 'istream::operatorError: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(470): 'istream::operator' is already definedFatal Error: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(518): too many errors Lines Processed: 599 Errors: 5 Warnings: 0 Build failed What am I doing wrong? I'm using version 8.25 of the compiler. I used the DOS Executable options. Thanks in advance for your help. Season's Greetings, Alexis. http://www.RestYourEyes.com' is already defined
Dec 25 2001
The problem is -Ju. -Ju is for old K&R C programs, it causes char overloading in C++ to fail. -Walter "Alexis Golzman" <agolzman ciudad.com.ar> wrote in message news:a09hk1$217r$1 digitaldaemon.com...Hi, I'm trying to compile this little program: #include <iostream.h> void main() { cout << "Hello World!\n"; } But I get the following errors: sc test.cpp -cpp -Ae -Ju -ms -o+time -3 -a2 -c -I. -otest.obj Error: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(443): 'istream::getline'isalready defined Error: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(452): 'istream::get' is already defined Error: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(468): 'istream::operatorerrorsError: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(470): 'istream::operator' is already definedFatal Error: C:\PROGTOOLS\DM\BIN\..\include\iostream.h(518): too many' is already definedLines Processed: 599 Errors: 5 Warnings: 0 Build failed What am I doing wrong? I'm using version 8.25 of the compiler. I used the DOS Executable options. Thanks in advance for your help. Season's Greetings, Alexis. http://www.RestYourEyes.com
Dec 25 2001
Now I changed the option to -J (chars are unsigned) and it works OK. Thanks! Alexis. | The problem is -Ju. -Ju is for old K&R C programs, it causes char | overloading in C++ to fail. -Walter
Dec 26 2001