Thread: visual c++ error

  1. #1
    Join Date
    Mar 2005

    visual c++ error


    when i try building my code with visual c++ 2005 Express Edition..

    the compiler gives the error..

    fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

    but when i use cygwin (g++) it compiles and runs fine...can someone tell me how i can fix this error...

    btw...when i do inlcude the suggested file gives a new error
    fatal error C1083: Cannot open precompiled header file: 'Debug\inheritance.pch': No such file or directory


  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    look in project options and turn off precompiled headers
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :-

  3. #3
    Absent Minded Programmer
    Join Date
    May 2005
    after you include that file, delete everything in the debug folder of your project, if you still get the debug error when you compile again, post the error message

  4. #4
    Registered User
    Join Date
    Jan 2005
    You don't need precompiled headers for a simple, portable program. Turn them off instead of including the file. When you create your project, make sure you create a blank solution instead of a Win32 Console Application. I believe the blank solution starts out with precompiled headers turned off, although I don't have the 2005 version to be sure.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  3. using c++ in c code
    By hannibar in forum C Programming
    Replies: 17
    Last Post: 10-28-2005, 09:09 PM
  4. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM
  5. <list>
    By Unregistered in forum C++ Programming
    Replies: 9
    Last Post: 02-24-2002, 04:07 PM