Absolute beginner!

This is a discussion on Absolute beginner! within the C++ Programming forums, part of the General Programming Boards category; This won't compile. I'm very, very new at this and don't understand why not I'm afraid... It is the very ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Location
    Auckland
    Posts
    3

    Absolute beginner!

    This won't compile. I'm very, very new at this and don't understand why not I'm afraid...

    It is the very first program... (I said I was a beginner!)

    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
      cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
      cin.get();
    }
    I get
    Error FIRST.CPP 1"unable to open include file "IOSTREAM""
    and...
    Fatal FIRST.CPP 3: Unable to create output file '\TC\FIRST.obj'

    help!!!!!!!

    In anticipation
    Leaghaire

  2. #2
    Registered User
    Join Date
    Nov 2007
    Location
    Auckland
    Posts
    3

    Talking

    7 views and no help! I thought this would be really easy for you guys
    Am I in the wrong folder or just too useless to be noticed?

    It is my first time here, so have I done something wrong... should I move the query to a different folder? Or am I just too hasty?

    Still hopeful,
    Lynda

  3. #3
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    #1 This is the wrong board, it should be in the C++ Board.
    #2 Not everyone here is an expert, so don't be expecting an immediate answer.
    #3 Don't bump threads. This is part of the forum guidelines (and is essentially the only thing you did wrong).

    With all that being said, the problem is that you compiler isn't finding iostream include. This means, I'd bet, that your compiler isn't set up properly. Since I don't know what compiler you're using, I can't tell you how to fix your problem. And even when you do, I can't guarantee a solution for you, as I may not have experience with it, in which case you'll have to wait for someone more experienced to come up.

    In the meantime, I'd try and find where your compiler is looking for the include files.
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  4. #4
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    You might have an older compiler and set of libraries. Try including <iostream.h> instead. And tell us what your compiler is.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Sounds like Turbo C++ 3, and that compiler wouldn't have the new headers.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,498
    > And tell us what your compiler is.
    Doesn't the \TC give it away?

    "Your compiler was last used by the druids to build Stonehenge".

    Oh, and post moved to the correct forum.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Registered User
    Join Date
    Oct 2007
    Posts
    66
    Just to make it clear in case you haven't figured it out already:

    iostream is a new header
    iostream.h is an old header

    The difference is iostream contains namespace std which means it's a standard header, and iostream does not.

    If you are using turbo C chances are you will need to include iostream.h and remove "using namespace std"

    You could download a newer free (personally I'll even say better) IDE & compiler from this link:

    http://msdn2.microsoft.com/en-us/express/aa975050.aspx

    Select "english" as the language for "VisualC++ 2005 Express Edition" and you'll be on your way to getting it! You'll need to register it once you DL it but that's free so no worries, and then you can install other development tools you need later on as you learn them.
    "When your work speaks for itself - don't interrupt!"

    -Samantha Ingraham.

  8. #8
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    or you could download Dev=C++ or code::blocks which are smaller in app size and use the GCC compiler. But get version 4.992 or wigetx 6.10 as they are most up to date and stable versions.
    I'm just trying to be a better person - My Name Is Earl

  9. #9
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    Doesn't the \TC give it away?
    I don't think I was even programming when Turbo C was recent...
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  10. #10
    Registered User
    Join Date
    Nov 2007
    Location
    Auckland
    Posts
    3
    Thank-you all for your replies. It is TURBO C++3.

    I am taking an evening classing in beginners C++ and was emailed this compiler as it is supposed to be very easy to use?

    I have Vista... I don't know if this makes a difference? I think I will just as tjpanda suggests and download the "VisualC++ 2005 Express Edition".

    Thanks again, any help is much appreciated

  11. #11
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,498
    > as it is supposed to be very easy to use?
    Maybe so, but it is still obsolete.

    We often find that the tutors have themselves learn "dialect-c++" which only works well with their favourite compiler, and they (the tutors) cling to it like some security blanket for fear of using something else.

    VC++ Express is definitely a step in the right direction.

    Though you might want to keep your TC++ because you might have to "dumb down" your answers to old-style C++ just to submit them to the tutor.
    If you can't persuade the tutor to "get with this century" and upgrade to a more recent compiler, then you might want to look into alternative courses.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  12. #12
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Leaghaire,

    I agree with the others that it's best to start-out with the same compiler your instructor is using. Your instructor and classmates can help you with it, and you won't run into a situation where your program works at home, but fails when you turn it in. (This is not supposed to happen if you are writing Standard ANSI/ISO C++, but it can happen.)

    Don't get discouraged... Installing, setting-up, and learning to use a compiler is usually a pain! I've used several different compilers, and sometimes it's taken me half a day to get Hello World (like your program) working. (Whenever I use a particular compiler for the first time, I always try Hello World first!)

    I recently upgraded my home compiler to Microsoft Visual C++ 2005 Express (the free version). I've used older versions of Visual Studio, so I know some of the "tricks" and I got Hello World working right away. (And, I had done some research so I already knew that I would need the Microsoft Platform SDK also.)

    However, I didn't get Hello Windows (a "simple" Windows GUI program) working until the next weekend. During the week, I probably spent 2 or 3 hours researching and "trying stuff", and another 2 or 3 hours "thinking" about the problem. (It was a problem similar to yours, where the compiler couldn't find a particular library.)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Absolute value of each element in a given array
    By DriftinSW20 in forum C Programming
    Replies: 9
    Last Post: 11-15-2007, 03:08 PM
  2. Replies: 14
    Last Post: 12-06-2006, 03:58 PM
  3. Replies: 14
    Last Post: 12-04-2006, 04:16 PM
  4. Absolute beginner
    By cstalnak in forum Tech Board
    Replies: 19
    Last Post: 01-22-2006, 01:44 AM
  5. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 10:21 AM

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