new to visual c++. Question....

Sharky Forums


Results 1 to 4 of 4

Thread: new to visual c++. Question....

  1. #1
    Catfish
    Join Date
    Oct 2000
    Posts
    131

    Question new to visual c++. Question....

    Hi all,

    i'm new to VC++ (and c++ in general, to be honest). I wanted to create a console application, and c++ always includes the file "stdafx.h", which it creates. For example, this happens when creating a new "Hello world" Win32 console app. Why is it that when i need this "stdafx.h" file? Other compilers are fine with:

    int main()
    {
    return 0;
    }

    but vc++ gives errors when i compile this. why? is there any way to simply print to the console without stdafx and all?

    thanks! sorry for any confusion
    -evan

  2. #2
    Reef Shark
    Join Date
    Apr 2001
    Location
    Austin, TX
    Posts
    371

    Post

    What errors are you getting? All you have to do to stop it from *****ing at you is give it whatever code bloat it wants.

    ------------------
    Advocate of the Sharky (Ultra) High-Resolution Club [SHRC]
    main(i){putchar(341513875>>(i-1)*5&31|!!(i<6)<<6)&&main(++i);}
    Advocate of the Sharky (Ultra) High-Resolution Club [SHRC]
    main(i){putchar(341513875>>(i-1)*5&31|!!(i<6)<<6)&&main(++i);}

  3. #3
    Reef Shark
    Join Date
    Apr 2001
    Location
    Austin, TX
    Posts
    371

    Post

    Oh, and what version are you using? Whatever it is, make sure it's fully patched to the latest version. In 6.0 the compiler actually *regressed* from 5.0 in native C++ support. I still run 5.0+sp3, and I'm very happy with it.

    ------------------
    Advocate of the Sharky (Ultra) High-Resolution Club [SHRC]
    main(i){putchar(341513875&gt;&gt;(i-1)*5&31|!!(i&lt;6)&lt;&lt;6)&&main(++i);}
    Advocate of the Sharky (Ultra) High-Resolution Club [SHRC]
    main(i){putchar(341513875>>(i-1)*5&31|!!(i<6)<<6)&&main(++i);}

  4. #4
    Catfish
    Join Date
    Oct 2000
    Posts
    131

    Post

    thanks for offering to help (always good to know ppl are out there!) but i figured it out!

    In the project settings, under the c++ tab, there is a directive to include the "stdafx" header file (the command looks something like '\Yu "stdafx.h"'. I just took that out and now it works. Before this, it would tell me that it couldn't find some precompiled header file (the stdafx file)

    thanks
    -ev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •