Results 1 to 9 of 9
  1. #1
    Unicow's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    With My Unicows
    Posts
    2,711
    Reputation
    70
    Thanks
    216
    My Mood
    Lurking

    [Help] Problem with Visual C++ 2010? IDK!

    Okay, so I started learning C++ very recently and so far I've got the "Hello World!" program memorized. I'm still not perfectly sure what each and every line does but I have a bit of an idea. I know that I got all of the statements (correct me if they're not called statements :P and congradulate me if I'm right!) but Visual C++ 2010 says it failed!

    Code:
    #include "stdafx.h"
    #include <iostream>
    
    int main()
    {
            std::cout << "Hello World!" << std::endl;
            return 0;
    }
    When I goto build solution it says 0 solutions and 1 fail... Anyone wana tell me what's wrong? I mean if I debug it then it works but debugging doesn't change anything and just stays the same but becomes successful and runs the program... I use Win32 Console Application.

  2. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    What Error does it give you?

  3. #3
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Like whit said, provide the error.

  4. #4
    Auxilium's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,518
    Reputation
    445
    Thanks
    609
    My Mood
    Happy
    Don't use win32 console application.

    Create a blank project, and on the right or left, right click the folder called 'source files' , add, new item. click C++ file and name it.

  5. #5
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    The code is right so u must be compiling it wrong. My advice? deselect precompiled headers next time you make a console app.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  6. #6
    mookamoka3's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    110
    Reputation
    14
    Thanks
    13
    what why said... or keep precompiled headers and dont change the _tmain() or whatever the default function was, to main. Cause theres nothing wrong with ur code..

    Also if u have trouble figuring out what the lines mean read the last thread you made here. I gave a retardedly long explination and you didnt even read it </3


  7. #7
    Unicow's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    With My Unicows
    Posts
    2,711
    Reputation
    70
    Thanks
    216
    My Mood
    Lurking
    Quote Originally Posted by mookamoka3 View Post
    what why said... or keep precompiled headers and dont change the _tmain() or whatever the default function was, to main. Cause theres nothing wrong with ur code..

    Also if u have trouble figuring out what the lines mean read the last thread you made here. I gave a retardedly long explination and you didnt even read it </3

    I actually did read it but all I could rlly figure out was the end lol <3

    Quote Originally Posted by mookamoka3 View Post
    what why said... or keep precompiled headers and dont change the _tmain() or whatever the default function was, to main. Cause theres nothing wrong with ur code..

    Also if u have trouble figuring out what the lines mean read the last thread you made here. I gave a retardedly long explination and you didnt even read it </3

    I actually did read it but all I could rlly figure out was the end lol <3

  8. #8
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by Unicow View Post
    I actually did read it but all I could rlly figure out was the end lol <3



    I actually did read it but all I could rlly figure out was the end lol <3
    (in other words, this has been solved)

  9. #9
    Unicow's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    With My Unicows
    Posts
    2,711
    Reputation
    70
    Thanks
    216
    My Mood
    Lurking
    Quote Originally Posted by freedompeace View Post
    (in other words, this has been solved)
    No... All he did was tell me the functions of each line... This has nothing to do with my problem...



    Problem has been solved anyways :P
    Last edited by Unicow; 02-10-2011 at 12:57 PM.