visual c++ error

This is a discussion on visual c++ error within the C++ Programming forums, part of the General Programming Boards category; hi, when i try building my code with visual c++ 2005 Express Edition.. the compiler gives the error.. fatal error ...

  1. #1
    Waxy-Dock
    Join Date
    Mar 2005
    Posts
    69

    visual c++ error

    hi,

    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 ...it gives a new error
    fatal error C1083: Cannot open precompiled header file: 'Debug\inheritance.pch': No such file or directory
    Square.cpp

    thanks.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    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 :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964
    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
    Posts
    7,319
    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, 12:10 AM
  5. <list>
    By Unregistered in forum C++ Programming
    Replies: 9
    Last Post: 02-24-2002, 03:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21