Thread: VS 2003 does not compile

  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    VS 2003 does not compile

    I'm trying to compile a non .NET C++ code in Visual Studio .NET 2003:
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
    	cout << "hello world" << endl;
    	return(0);
    }
    When I get the next weird error message:
    c:\test_proj\test_proj.cpp(10): fatal error C1010: unexpected end of file while looking for precompiled header directive
    Does anyone know why do I get the error?


    Thank you.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    turn off precompiled headers in project options
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    But why is the option comes by default, what is it good for?
    Last edited by Devil Panther; 09-28-2005 at 03:07 AM.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    If that is MFC I think you needed to include

    StdAfx.h
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    well that's just it... the default project does not compile even with the stdafx.h, unless i disable the option....
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  6. #6
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Try creating a new empty Win32 Console project by following these instructions

    Then enter your code again, and see if it compiles fine without you needing to disable the precompiled headers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 09:05 PM
  2. release vs debug in msvs .net 2003
    By axr0284 in forum Windows Programming
    Replies: 1
    Last Post: 01-10-2006, 01:52 AM
  3. VS 2003 compile issues?
    By Dan911 in forum C++ Programming
    Replies: 4
    Last Post: 08-23-2005, 03:17 PM
  4. open scene graph compile issues
    By ichijoji in forum Game Programming
    Replies: 1
    Last Post: 08-04-2005, 12:31 PM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 02:58 PM