www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Problems with iostream.h (bugs?)

↑ ↓ ← "Alexis Golzman" <agolzman ciudad.com.ar> writes:
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::operator
' is already defined


' is already defined


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
Dec 25 2001
↑ ↓ "Walter" <walter digitalmars.com> writes:
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'

 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::operator
' is already defined


' is already defined



 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

Dec 25 2001
↑ ↓ → "Alexis Golzman" <agolzman ciudad.com.ar> writes:
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