Results 1 to 2 of 2

Thread: Why doesnt this work?

  1. #1
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 02
    Location
    . . . my reason of shame
    Posts
    2,729

    Why doesnt this work?

    I have a new c++ proj in MSVC++ 7.0

    Code:
    #include "iostream.h"
    
    int _tmain(int argc, _TCHAR* argv[]) {
    	return 0;
    }
    Why wouldn't this work? It says:
    unexpected end of file while looking for precompiled header directive

    It means what? I can only make a proj if I'll have a header too? I even tried to put one(I deleted ALL the default files it puts on my proj) and it still gave me error.

    Could someone enlight me up
    \m/\m/

  2. #2
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 01
    Location
    Boulder, Colorado
    Posts
    1,403
    It means you have the option for "precompiled headers" enabled in the project options tab somewhere. If you have a precompiled header, you will need to include it at the top of every cpp file
    Code:
    #include "stdafx.h"
    Otherwise, look in the project settings and turn it off.

    In addition, quotes are for header files found in the project directory. brackets are for files found in the include directory:
    Code:
    #include <iostream>
    using namespace std;
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

Posting Permissions

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