none
"stdafx.h" no such file or directory ... wtf???

    Question

  • Hi,

    I just created a new project using the existing files of an old one I was sent but when I try to build it I get this error despite the file is in the include-directory of the project.

    How can this be?


    Cheers
    Simon
    Monday, August 18, 2008 10:46 AM

Answers

  • Whereever u find the following statement

    #include <stdafx.h>

    Place the cursor within the "stdafx.h" and right click, then Choose open Document "stdafx.h"

    Tell me if it is opening or not in VS2005
    If the posted one is answer, Please close the Post. - NambiRaj
    Monday, August 18, 2008 11:45 AM

All replies

  • What error u r getting, put errors clearly and which visual studio u  r using is it 6.0 or VS 2005
    If the posted one is answer, Please close the Post. - NambiRaj
    Monday, August 18, 2008 10:48 AM
  • I'm using VS2008 SP1 and the application target is a Windows Mobile device.

    The exact error message looks like this:


    Error 1 fatal error C1083: File (Include) cannot be opened: "stdafx.h": No such file or directory d:\Eigene Dateien\Aloqa\Plugin_4.5\TestPOIPlugin\TestPOIPlugin.cpp 12 TestPOIPlugin
    • Edited by schnesim Monday, August 18, 2008 10:52 AM fixed
    Monday, August 18, 2008 10:51 AM
  • Have u included anywhere the stdafx.h file in your project
    If the posted one is answer, Please close the Post. - NambiRaj
    Monday, August 18, 2008 10:53 AM
  • I have three .cpp files all of which have a "'include "stdafx.h"" statement.
    Monday, August 18, 2008 11:01 AM
  • is stdafx.h is present in your project folder
    If the posted one is answer, Please close the Post. - NambiRaj
    Monday, August 18, 2008 11:03 AM
  • Shure, as I said it's in the headers directory of the project.
    Monday, August 18, 2008 11:17 AM
  • Place the mouse cursor in "stdafx.h" and right click Mouse.  Then choose Open Document "stdafx.h"
    is it opening the stdafx.h file in VS2005
    If the posted one is answer, Please close the Post. - NambiRaj
    Monday, August 18, 2008 11:22 AM
  • Whereever u find the following statement

    #include <stdafx.h>

    Place the cursor within the "stdafx.h" and right click, then Choose open Document "stdafx.h"

    Tell me if it is opening or not in VS2005
    If the posted one is answer, Please close the Post. - NambiRaj
    Monday, August 18, 2008 11:45 AM
  • I just tested it and the stdafx.h doesn't open. Instead the following header file (if there is one) is opened.
    Monday, August 18, 2008 12:13 PM
  • Problem in the meantime solved. Reason stupidness of the user
    Monday, August 18, 2008 3:25 PM
  • Out of curiosity, what was the problem?
    Monday, August 18, 2008 4:43 PM