Thread: Newbie have problem using dev-C++

  1. #1
    sunzoner
    Guest

    Question Newbie have problem using dev-C++

    To All,

    I'm a newbie using Dev-C++.
    I got a message "iostream.h: no such file or directory".
    When I add the directory in my "project options", I get more errors.
    May I know what is the problem? Please look at my code below:

    #include <iostream.h>

    int main ()
    {
    cout << "Hello world";
    return 0;
    }

  2. #2
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317
    That was a somewhat common problem with previous versions... Are you using the latest one? Version 4.9.3.0?

    If so, are you installing dev-cpp to a 8.3 conformant directory? Install it to c:\dev-c++ or something like that. The idea is not to use a path with long filenames. I'm really not sure if that is the problem, to be honest. But I seem to remember that being said either on blodsheed's mailing list or the forums.
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

  3. #3
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    Did you download the one with the compiler?
    Maybe that's the problem (no compiler).
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

  4. #4
    Unregistered
    Guest
    I'm using version 4.9.3.0
    Is it an error with the software or my coding...
    If it is an error with software, how should I report it?

  5. #5
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317
    I was able to reproduce your error message when I created a C project, instead of a C++ one. All of a sudden, the include directory was not being used by the compiler. You can set the path to it on the compiler options, but its not being used.

    Anyway, to report the bug go to the About dialog box in dev-c++ and click on the forums links. On the webpage that will show up, click on the Bugs link.
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

  6. #6
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    Aha. 10:1 you're compiling as a C project instead of a C++ project (from Mario's post). iostream is not a C header it's a C++ one.
    Go to Project->Project Options and make sure the "compile as C++" box is checked. Otherwise use <stdio.h> and printf() instead. Before you go reporting a bug about try that first.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

  7. #7
    sunzoner
    Guest
    Thanks Mario, taylorguitarman and all, that solve the problem.

  8. #8
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317
    Glad it's working now.

    But bear in mind that the bug still exists. It's all ok for C++, but under C code, dev-cpp doesn't recognize the include directory even if you type it under the options dialog box.
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strange problem with dev cpp
    By henrychan22 in forum C++ Programming
    Replies: 8
    Last Post: 06-18-2006, 11:05 AM
  2. Newbie question: Problem with malloc
    By Ikim in forum C Programming
    Replies: 2
    Last Post: 02-05-2006, 10:11 PM
  3. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 12:53 PM
  4. Dev C++ Problem
    By kas2002 in forum C++ Programming
    Replies: 6
    Last Post: 06-14-2002, 03:09 PM
  5. newbie coding problem
    By rippascal in forum C++ Programming
    Replies: 10
    Last Post: 01-08-2002, 11:45 PM