Dev-C++ 4.9.9.2 is screwed up

This is a discussion on Dev-C++ 4.9.9.2 is screwed up within the C++ Programming forums, part of the General Programming Boards category; I have been using Dev-C++ 4, you know the one just under the BETA version. Well I finally decided to ...

  1. #1
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532

    Dev-C++ 4.9.9.2 is screwed up

    I have been using Dev-C++ 4, you know the one just under the BETA version. Well I finally decided to upgrade to the BETA version, so I download it and install it. Everything seems to be fine until I write a small console app that just outputs to the screen. Here is the exact code used:
    Code:
    #include <iostream>
    #include <stdlib.h>
    
    int main()
    {
        cout<<"Hello"<<endl;
        system("PAUSE");
        return 0;
    }
    And here are my errors:
    Code:
     C:\WINDOWS\Desktop\hello.cpp In function `int main()': 
    6 C:\WINDOWS\Desktop\hello.cpp `cout' undeclared (first use this function) 
      (Each undeclared identifier is reported only once for each function it appears in.) 
    6 C:\WINDOWS\Desktop\hello.cpp `endl' undeclared (first use this function)
    What is up with that? I included iostream which defines cout and endl and Dev decides it doesn't like that code anymore. Any ideas? Is Dev configured wrong or what?
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Oh do not throw around such harsh accuasations! We are all well aware that cout is a part of the std namespace, meaning you can reference it as such explicitely

    Code:
    std::cout << stuff;
    Or map all of STL into the current namespace

    Code:
    using namespace std;
    cout << stuff; // Like you tried

  3. #3
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532
    Ok, thanks. But why would would the old version of Dev not make you call "using namespace std;"? Now I have the bad habit of not including "using namespace std;" because the old version of Dev didn't require it to use those functions....
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

  4. #4
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    using a namespace globally isn't good practice anyway

  5. #5
    Registered User
    Join Date
    Dec 2003
    Posts
    50
    Hi,

    For those who are interested, here is an article "Using Namespaces"
    from http://www.cprogramming.com/tutorial/namespaces.html

    Best Regards,
    Yeoh

  6. #6
    1479
    Join Date
    Aug 2003
    Posts
    253
    Quote Originally Posted by jmd15
    I have been using Dev-C++ 4, you know the one just under the BETA version. Well I finally decided to upgrade to the BETA version, so I download it and install it.
    It's a good idea to make sure you uninstalled the old version of Dev. It could cause a few problems as it did with me when I 'upgraded'.
    Knowledge is power and I want it all

    -0RealityFusion0-

  7. #7
    Registered User
    Join Date
    Mar 2002
    Posts
    125
    Quote Originally Posted by jmd15
    Ok, thanks. But why would would the old version of Dev not make you call "using namespace std;"?
    Because DevC++4 is screwed up?
    I think the betas of DevC++5 automatically add the global namespace thing to the main source file. Anyway, you're probably better off getting used to putting std:: in front of just about everything.
    Typing stuff in Code::Blocks 8.02, compiling stuff with MinGW 3.4.5.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Whats better, C-Free or Dev C++??
    By i_can_do_this in forum Tech Board
    Replies: 10
    Last Post: 07-07-2006, 05:34 AM
  2. Resources with Dev C++ Problem (many simple problems)
    By Zeusbwr in forum Windows Programming
    Replies: 4
    Last Post: 04-07-2005, 12:08 AM
  3. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 01:05 AM
  4. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 08:43 PM
  5. Tutorial about Bloodshed Dev!
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2001, 07:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21