Thread: Epic fail by me

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused

    Epic fail by me

    Epic fail by /me

    Explanation:

    I'm following a tut on how to create a 'Hello World' in C++... I know half of you are like
    "How can you fuck that up?" Dx Well, I managed to. I'm not positive what the issue is
    But I'm getting an error: Error 1 fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory c:\Documents and Settings\Phil\My Documents\Visual Studio 2008\Projects\HelloWorld\HelloWorld\HelloWorld.cpp 4

    Code:
    #include <iostream.h>
    
    int main()
    {
    	cout << "Hello World!\n";
    	return 0;
    }
    File Name: HelloWorld.cpp
    Compiler: Microsoft Visual C++ Express 2008

    Can't believe I messed up on just this tiny project >

    Anyways, hopefully someone will be able to help me

  2. #2
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Take out the ".h" from "<iostream.h>", so it's just:

    #include <iostream>

    For a preprocessor directive.

  3. The Following User Says Thank You to Lolland For This Useful Post:

    Alroundeath (06-28-2010)

  4. #3
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by lolland View Post
    Take out the ".h" from "<iostream.h>", so it's just:

    #include <iostream>

    For a preprocessor directive.
    Much appreciated for the quick response
    /Thanked
    But now It won't allow me to compile
    Apologies for the... Complications xP

  5. #4
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Is it showing an error?

    Are you seeing anything?

    Is the console flashing just once?

  6. #5
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by lolland View Post
    Is it showing an error?

    Are you seeing anything?

    Is the console flashing just once?
    None of the above :|

    The 'Start Debugging' button is greyed out

    I'm not sure what caused it, but it's fine now o.o
    Last edited by Alroundeath; 06-28-2010 at 07:06 AM.

  7. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    right click the project and select Rebuild =)
    Ah we-a blaze the fyah, make it bun dem!

  8. #7
    thekm1994's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    79
    Reputation
    8
    Thanks
    1
    My Mood
    Daring
    iostream is a libary that work on the standard way(way=namespace) (std=standard), every libay that doesnt work that way has the (.h) at the end , that why when you will see (include<windows.h>) and the user used a functions from the (windows.h) he altought used the ("using namespce std;")
    lets say that everything that ISNT std ' the compiler read it in other way , or he dont read it at all and he tell the user that there was a problem in compiling this program !
    I m a C++ hacker , but , i geuss you have a book of C or C++ in your home !
    that books are telling you (almost all of the book) a functions from 1-3 libarys , my tip is you to learn it But to be consetret on how does the C and C++ work (?) !
    i mean , if you want to know a knew things you may go to other libarys and search there for a new functions , you have to read EVERY line to know what they did in the other line ! (that other line could be in the more 1000 lines , )
    its hard but good luck with it
    If you wanna see how to make a someone dumb press here

  9. #8
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    I have another question, I was told to follow a 'book' "Teach yourself C++ in 21 Days" I chose this path since I can't take any classes for this at my local shool... So, I chose to do this in replacement of person to person lessons.

    Anyways, I'm following this guide and It's telling me to type in code and compile it... Well... I dunno what type of project I should create to add the .cpp file to it... It seems I can't build/debug/compile without an actual project..

    Code:
    1: #include <iostream.h>
    2: int main()
    3: {
    4: int x = 5;
    5: int y = 7;
    6: cout "\n";
    7: cout << x + y << " " << x * y;
    8: cout "\n";
    9:return 0;
    10: }
    Idk what to do :|

  10. #9
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Are you using MSVC++ or Dev-CPP?
    on MSVC++ create an empty win32 console app, then rightclick on the source folder and hit add new item to create a new .cpp file

    On Dev-CPP I believe it's file->new project ->console project, but i'm not sure as I never use Dev-CPP
    Ah we-a blaze the fyah, make it bun dem!

  11. #10
    lauwy's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    522
    Reputation
    19
    Thanks
    1,106
    Quote Originally Posted by Alroundeath View Post


    Much appreciated for the quick response
    /Thanked
    But now It won't allow me to compile
    Apologies for the... Complications xP


    I alway's use:

    #include <iostream>
    using namespace std;

    That works

    ____

    Open dev c++, then click one ctrl + n
    You can debug and comp with f9

  12. #11
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    114
    My Mood
    Twisted
    Quote Originally Posted by Alroundeath View Post
    I have another question, I was told to follow a 'book' "Teach yourself C++ in 21 Days" I chose this path since I can't take any classes for this at my local shool... So, I chose to do this in replacement of person to person lessons.

    Anyways, I'm following this guide and It's telling me to type in code and compile it... Well... I dunno what type of project I should create to add the .cpp file to it... It seems I can't build/debug/compile without an actual project..

    Code:
    1: #include <iostream.h>
    2: int main()
    3: {
    4: int x = 5;
    5: int y = 7;
    6: cout "\n";
    7: cout << x + y << " " << x * y;
    8: cout "\n";
    9:return 0;
    10: }
    Idk what to do :|
    1. That code is far off, if you got that right out of your book I advise you to stop reading it immediately
    But by juding on how to code looks however I think you missed something
    Maybe the book made a header 'iostream.h' and you missed it somehow
    If that isn't te case, return to 1

    good luck

  13. #12
    lalakijilp's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    310
    Reputation
    9
    Thanks
    53
    My Mood
    Blah
    Quote Originally Posted by Alroundeath View Post
    I have another question, I was told to follow a 'book' "Teach yourself C++ in 21 Days" I chose this path since I can't take any classes for this at my local shool... So, I chose to do this in replacement of person to person lessons.

    Anyways, I'm following this guide and It's telling me to type in code and compile it... Well... I dunno what type of project I should create to add the .cpp file to it... It seems I can't build/debug/compile without an actual project..

    Code:
    1: #include <iostream.h>
    2: int main()
    3: {
    4: int x = 5;
    5: int y = 7;
    6: cout "\n";
    7: cout << x + y << " " << x * y;
    8: cout "\n";
    9:return 0;
    10: }
    Idk what to do :|
    I advise you to start using Dev C++ at the beginning. you only have to use 1 button to make a new file and 1 button to compile.
    visual-C++ almost requires a tutorial itself

  14. #13
    shad0w''s Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    27
    Reputation
    12
    Thanks
    13
    std::cout <<
    Global namespace dosn't contain 'cout'
    [IMG]https://i234.photobucke*****m/albums/ee320/silent712/Shad0w1-1.png[/IMG]

  15. #14
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    If you are using MSVC++ just keep with it, there is nothing wrong with it. and it is the best compiler...
    Plus, you should include your namespace there just like someone said already.

    using namespace std; (this after #include <iostream>)

    or

    std::cout << etc etc
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  16. #15
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by Hell_Demon View Post
    Are you using MSVC++ or Dev-CPP?
    on MSVC++ create an empty win32 console app, then rightclick on the source folder and hit add new item to create a new .cpp file

    On Dev-CPP I believe it's file->new project ->console project, but i'm not sure as I never use Dev-CPP
    Microsoft Visual C++

    Quote Originally Posted by schim View Post
    1. That code is far off, if you got that right out of your book I advise you to stop reading it immediately
    But by juding on how to code looks however I think you missed something
    Maybe the book made a header 'iostream.h' and you missed it somehow
    If that isn't te case, return to 1

    good luck
    Err... Not exactly sure what a header is, as it hasn't explained it in this book :|

    Quote Originally Posted by Brinuz View Post
    If you are using MSVC++ just keep with it, there is nothing wrong with it. and it is the best compiler...
    Plus, you should include your namespace there just like someone said already.

    using namespace std; (this after #include <iostream>)

    or

    std::cout << etc etc
    once again, almost clueless about what you said.
    If anyone has a better book I could download or read online, that would be great.
    Because as far as I've read on this thread, I shouldn't be looking for guidance to
    a book that can't show me what I need to know for the basics.


    Anyway, I appreciate the comments =D

Page 1 of 2 12 LastLast

Similar Threads

  1. Epic Fail
    By Miyama Yuna in forum General
    Replies: 10
    Last Post: 11-30-2008, 11:38 AM
  2. Who has epically failed before?
    By Gotchuthief in forum General
    Replies: 13
    Last Post: 10-27-2008, 11:03 PM
  3. EPIC FAIL
    By Q in forum General
    Replies: 5
    Last Post: 10-25-2008, 03:37 PM
  4. I epically failed.
    By SheGotIt in forum Combat Arms Hacks & Cheats
    Replies: 53
    Last Post: 10-15-2008, 07:26 AM
  5. Epic Fail Sign
    By moosicgawd in forum Art & Graphic Design
    Replies: 19
    Last Post: 10-14-2008, 01:40 PM