Dev-C++ Trouble

Thadius Dean

Newbie
Joined
Aug 20, 2003
Messages
884
Reaction score
0
when i try to compile a program, the half-life program "iostream.h" appears as a new tab and makes it impossible to compile because the "#include "backward_warning.h" or line 31:1 makes an error.

if you want to see the code that pops up its;

Code:
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING.  If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.

// As a special exception, you may use this file as part of a free software
// library without restriction.  Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.  This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.

#ifndef _CPP_BACKWARD_IOSTREAM_H
#define _CPP_BACKWARD_IOSTREAM_H 1

#include "backward_warning.h"
#include <iostream>

using std::iostream;
using std::ostream;
using std::istream;
using std::ios;
using std::streambuf;

using std::cout;
using std::cin;
using std::cerr;
using std::clog;
#ifdef _GLIBCPP_USE_WCHAR_T
using std::wcout;
using std::wcin;
using std::wcerr;
using std::wclog;
#endif

using std::ws;
using std::endl;
using std::ends;
using std::flush;

#endif

// Local Variables:
// mode:C++
// End:

...help?
 
um, "the half-life program "iostream.h""?

post the error message and we may be able to help :)
 
The unit you are trying to compile would probably help too. :p
 
iostream.h is deprecated.
Change your code to "#include <iostream>" and put "using namespace std;" after that (or manually tell it to use std::cout, whatever you need).

[edit]
With changing your code to "#include <iostream> I mean, changing the "#include <iostream.h>" to "#include <iostream>". No quotes.
[edit2]
In case you're trying to compile the HL SDK, I'd really go with MSVC6 (or higher). The SDK simply won't compile with MingW without chaning a bunch of stuff.
 
well im absolutely new to programming, im still working out a simple c = a - b program, so i understood nothing of what any of you just said :p

i think the error message is "31 C:\Dev-Cpp\include\c++\backward\iostream.h
In file included from C:/Dev-Cpp/include/c++/backward/iostream.h
"
i uninstalled the source code, i uninstalled and redownloaded Dev C++ but those still didnt work.
 
its not the code that did it the first time, but it happens every time so this should count.

Code:
#include <iostream.h> 

int main() 

{ 
    int a, b, ans;
    
    cout << "What is your first number?";
    cin >> a;
    
    cout << "What is your second number?";
    cin >> b;
    
    ans = a - b
    
    cout << "Your first number minus your second number is";
    cout << ans;
	
 return 0;

}
 
Instead of
Code:
#include <iostream.h>
in your code, write:
Code:
#include <iostream>

using namespace std;
since the iostream.h header is deprecated and shouldn't be used.
 
because that code is wrong as of about 1998, change the <iostream.h> to <iostream> and place either 'using namespace std;' at the top of the code (after the #include) or at the top of the function or place std:: before all the cout and cin lines.

That however will only fix that code, my advice, get a better tutorial/book as the one you are using is wrong, You need to get one which teaches you proper C++ and uses the standard namespace.

If this error is accuring while recompiling the HL SDK then you'll need to fix the file to work, however if you are only just learning C++ that is beyond the scope of that i can explain to you right now, my best advice is go away and learn the basics properly.
 
well, i dont have a book yet, just usin' that cplusplus tutorial.
ok ill put that in and try it out...

sweet, it works, now im only getting regular error messages :p

thanks guys.
 
I know alot of C++ but....

I mean, do you guys think this book called "Half-Life 2: Mod Makers Prima Strategy Guide " will help me or anyone else learn more about MODing in HL2 or for any other game. The cover looks good....lol :LOL:

Well, I am buying it just to see how it is, someone should e-mail Valve and find out what they think. If you do a search for it on google.com or yahoo.com, I know you can find it.
:borg:
 
Back
Top