precompiled header compiled as C++ when I want C

This is a discussion on precompiled header compiled as C++ when I want C within the Windows Programming forums, part of the Platform Specific Boards category; I'm using Visual C++ 2005 Express and I'm trying to compile my simple test Windows program to see if DrawDibDraw ...

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

    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 05:47 AM. Reason: changed title to be more accurate

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,344
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 06: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, 09:51 AM
  5. header and source files
    By gtriarhos in forum C Programming
    Replies: 3
    Last Post: 10-02-2005, 03:16 AM

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