Jump to content


Strange error in stdafx.h (c++)


7 replies to this topic

#1 WoOdSpEaK StUdIoS

    New Member

  • Members
  • PipPip
  • 20 posts

Posted 02 October 2006 - 11:28 AM

Whenever I attempt to compile win32 applications after I installed the platform SDK into Visual Basic 2005 Express edition, I am recieving a fatal error thanks to sdafx.h:

c:\documents and settings\hamish\my documents\visual studio 2005\projects\tetris\tetris\stdafx.h(28) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

is it something I am doing wrong or a common error? Help appriciated.

EDIT: the part of sdafx.h that is causing the problems is this:

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>


EDIT AGAIN: if need be, can someone who has the file send it to me? that may or may not solve the problem.

EDIT YET AGAIN: I have discovered that the file "windows.h" exists, and I have linked everything properly, but stdafx.h just can't find it. I have no idea what the hell is going on, and need help.

#2 Sturm

    New Member

  • Members
  • PipPip
  • 26 posts

Posted 02 October 2006 - 02:57 PM

You should have the file on your system (depending on tools/installs) asair it's part of the Windows SDK so you can get it there. It might just be a include part that is missing, have you checked that you have everything set up correctly?

#3 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 02 October 2006 - 06:10 PM

Did you add the include path for the Windows SDK into your include directories in VC++? Err... did you say Visual Basic? How are you including a C header file in a Visual Basic project?
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*

#4 WoOdSpEaK StUdIoS

    New Member

  • Members
  • PipPip
  • 20 posts

Posted 02 October 2006 - 09:20 PM

Monjardin~
sorry I meant Visual C++.

#5 WoOdSpEaK StUdIoS

    New Member

  • Members
  • PipPip
  • 20 posts

Posted 02 October 2006 - 10:37 PM

Sorry to double post but do you think it might work if I download another copy of the file from the Platform SDK? Or will that just do nothing?

#6 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 02 October 2006 - 11:11 PM

Like I said, did you add the paths to VC++?

RTFM (Using Visual C++ 2005 Express Edition with the Microsoft Platform SDK) and pay particular attention to Step 3.
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*

#7 WoOdSpEaK StUdIoS

    New Member

  • Members
  • PipPip
  • 20 posts

Posted 03 October 2006 - 01:18 AM

yes I have updated the paths

#8 WoOdSpEaK StUdIoS

    New Member

  • Members
  • PipPip
  • 20 posts

Posted 05 October 2006 - 06:36 AM

Oh thanks monjardin! I worked out what was wrong: front slash not backslash! Quite embarrassing, really. Should've checked sooner. Thankyou!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users