Thread: precompiled header compiled as C++ when I want C

  1. #1
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582

    precompiled header compiled as C++ when I want C

    I'm using Visual C++ 2005 Express and I'm trying to compile my simple test Windows program to see if DrawDibDraw works as expected, but I got dozens of errors since I'm using C code as a C++ file (file reading and writing wasn't working, my struct didn't work, and other strange things. I renamed the file to a C file and now I'm left with one error that I don't know how to fix and it's not an error in my code.

    c:\my documents\my programs\first windows app\first windows app\first windows app.c(13) : fatal error C1853: 'Debug\First Windows app.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)
    I originally was using C++ but due to the numerous errors I was getting, I went with C. The fix is to somehow recompile the precompiled header but how do you do that?
    Last edited by ulillillia; 12-17-2006 at 06:47 AM. Reason: changed title to be more accurate

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Turn off pre-compiled headers in the project settings.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. IP header "total length" vs. packet size
    By MK27 in forum Networking/Device Communication
    Replies: 2
    Last Post: 01-04-2009, 07:45 AM
  2. Replies: 7
    Last Post: 09-23-2008, 11:18 AM
  3. class header confusion
    By te5la in forum C++ Programming
    Replies: 2
    Last Post: 07-22-2008, 02:39 PM
  4. Header Files
    By Volair in forum C Programming
    Replies: 2
    Last Post: 12-09-2005, 10:51 AM
  5. header and source files
    By gtriarhos in forum C Programming
    Replies: 3
    Last Post: 10-02-2005, 03:16 AM