From: Martin Str|mberg Subject: C++ compiler not working Newsgroups: comp.os.msdos.djgpp References: User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha)) Message-ID: <1026916068.219@queeg.ludd.luth.se> Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Date: 17 Jul 2002 14:27:48 GMT Lines: 114 NNTP-Posting-Date: 17 Jul 2002 14:27:48 GMT NNTP-Posting-Host: queeg.ludd.luth.se X-Trace: 1026916068 news.luth.se 466 130.240.16.109 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com You should put a meaningful subject on your posts. Diogo Abdalla wrote: : Third, I a complete begginer on all those C++ and DJGPP stuff. Actually, I : was trying to create my first C++ program. : Well, following the instructions of a tutorial I wrote, in Rhide, this : little code: : #include : int main() : { : cout << "Hello!"; : return 0; : } This doesn't look like a correct C++ program (.h and no using or std::). : Then the nightmare begun. I got an error saying that the compiler could not : find iostream.h. Ive searched my HD for the file and found it on : djgpp\lang\cxx-v31\backward\. Then I copied the file to djgpp\include (I was : supposed to do that?) and tried it again. This time, the compiler found No. You're only breaking things. : iostream.h, but it gave me an error saying that the file contains one or : more "deprecated" headers (What means "deprecated", anyway? ). It means "don't use this, it's old". : Then I decided tho look on the FAQ for an awser. he FAQ said that I should : download the file "gpp2952b.zip", and I did that and installed the pack. I Ok. So now you have a mix of gcc 3.something and gcc 2.95.2. That is not helping. Even more things are broken now. : found a new subdirectory on djgpp\lang, called "cxx", and I found iostream.h : on it. Again, Ive copied this new iostream.h to the djgpp\include (again, : should I be doing this?) and tried to compile again. Well, now the compiler No. : It seems that the file I got is not working at all. And now I got no idea : what else could I do. DJGPP appears to be working correctly, aside from this : problem: I compiled and executed a little program just like this one using : stdio.h and printf instead of iostream.h and cout and it worked (I managed : to get a "Hello" on the screen). So you can compile C programs but not C++? : Ive read the FAQs, the docs the infos and all that and Im still hopeless. : How can I learn C++ if I cant even get a compiler to work? I not sure that That's hard. But remember that your program is incorrect. You should get warnings and errors from it. If not, then the C++ compiler is broken. : the problem is only with iostream.h: maybe there is problems with other : readers too that I havent tried to use yet. Im realy desperated and this I don't understand what you mean with "other readers". : Im sure Im doing something wrong, something realy stupid. I just need you : guys to point what exactly Im doing wrong. Please help me. Im using Rhide as : the IDE and running on Windows 95. : My autoexec.bat: : @ECHO OFF : LH C:\SDD\UNIVBE32.EXE -W : LH C:\AMOUSE\AMOUSE.COM : LH C:\MSCDEX.EXE /D:OEMCD001 /L:D : KEYB BR,,C:\WINDOWS\COMMAND\KEYBOARD.SYS : MODE CON CODEPAGE PREPARE=((850) C:\WINDOWS\COMMAND\EGA.CPI) : MODE CON CODEPAGE SELECT=850 : SET BLASTER=A220 I5 D1 T4 : rem DJGPP and etc : SET DJGPP=C:\DJGPP\DJGPP.ENV : SET RSXNTDJ=C:\RSXNTDJ : SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;%RSXNTDJ%\bin;C:\DJGPP\BIN You're using RSXNTDJ. Why if you only want to learn C++? Remove RSXNTDJ from the path. : SET C_INCLUDE_PATH=%RSXNTDJ%\include\win32\anders This one isn't doing any good either. 1. First make sure that DJGPP had a chance of working properly (that means removing RSXNTDJ). 2. Considering all your tinkering, remove the whole DJGPP istallation as well and reinstall it. 3. Don't mix gccXb.zip with gppYb.zip, where X != Y. Decide which version you'll use and stick with that. 3a. If you want to do proper C++ (as near the standard of today as possible), you want to use X (in 3.) as high as possible, which means 31 today. 3b. If you insist on using broken C++ according to your post above, use X < 3. 2952 should be possible. 4. Don't move around headers. They should be where they are. Moving them will only break things more. After this, post back with what you installed, how your AUTOEXEC.BAT looks now, your test program(s) and what errors you're getting. Right, MartinS