locked
sqlite3 and stdafx.h RRS feed

  • Question

  • I have added sqlite-amalgamation to my project and at the top of 'sqlite3.c' I added

    #include"stdafx.h"

    this gives me an error that reads:

    fatal error C1853: 'Debug\My_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)

    Well, the precompiled header is C++ and sqlite3.c is C code, the error is correct, but how do I fix this problem?

    Friday, December 21, 2012 5:08 AM

Answers

  • I have added sqlite-amalgamation to my project and at the top of 'sqlite3.c' I added
    #include"stdafx.h"
     
    this gives me an error that reads:
     
    fatal error C1853: 'Debug\My_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)
     
    Well, the precompiled header is C++ and sqlite3.c is C code, the error is correct, but how do I fix this problem?
    Why do you want to include "stdafx.h" in this file?
     
    Just disable precompiled headers for this file
     
    File Properties->Configuration Properties->C/C++->Precompiled Headers
     

    David Wilkinson | Visual C++ MVP
    Friday, December 21, 2012 11:32 AM

All replies

  • I have added sqlite-amalgamation to my project and at the top of 'sqlite3.c' I added
    #include"stdafx.h"
     
    this gives me an error that reads:
     
    fatal error C1853: 'Debug\My_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)
     
    Well, the precompiled header is C++ and sqlite3.c is C code, the error is correct, but how do I fix this problem?
    Why do you want to include "stdafx.h" in this file?
     
    Just disable precompiled headers for this file
     
    File Properties->Configuration Properties->C/C++->Precompiled Headers
     

    David Wilkinson | Visual C++ MVP
    Friday, December 21, 2012 11:32 AM
  • Thanks for your help, it worked very nicely!

    In regards to your question, all I can say is... well, I am new to VS, I am not learning C++, but I am a coplete Nu-B when it comes to VS.

    I again thanks man!

    Friday, December 21, 2012 2:35 PM