6 Replies - 28531 Views - Last Post: 26 March 2006 - 05:51 PM Rate Topic: -----

#1 quim  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 18
  • View blog
  • Posts: 182
  • Joined: 11-December 05

#include <windows.h> problem

Posted 25 March 2006 - 06:56 PM

I am learning win32 right now:
help me with this. Everytime I try to compile this program which those nothing yet.
#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  LPSTR lpCmdLine, int nShowCmd)
{
	return 0;
}



I receive this error.
Error	1	fatal error C1083: Cannot open include file: 'windows.h': No such file or directory	c:\documents and settings\quim costa\my documents\visual studio 2005\projects\march 25\march 25\main.cpp	1



Is This A Good Question/Topic? 0
  • +

Replies To: #include <windows.h> problem

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: #include <windows.h> problem

Posted 25 March 2006 - 07:59 PM

This could be a number of things...first and foremeost, have you specified the project type as a win32 project, instead of a console project (it needs to be win32). Second, are you using standard C++ or managed C++ (I note you are using Visual Studio 2005). Thirdly, have to treid completely closing that project, and starting another with the same code, then compiling?
Was This Post Helpful? 0
  • +
  • -

#3 quim  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 18
  • View blog
  • Posts: 182
  • Joined: 11-December 05

Re: #include <windows.h> problem

Posted 25 March 2006 - 08:16 PM

Now I notice that when I copy that code paste in my other C++ computer.
Dev-C++ that same code compiled with no Error.
Now I ask what do you think is wrong with my Visual C++ 2005 Express Edition.
1-If you use Visual C++ 2005 Express Edition can you compile this code and tell me if it compile without Error.


Thanks for the repliers.
Was This Post Helpful? 0
  • +
  • -

#4 Mrafcho001  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 41
  • View blog
  • Posts: 769
  • Joined: 01-November 05

Re: #include <windows.h> problem

Posted 25 March 2006 - 08:40 PM

I believe the Express editions come without the Win32 SDK.

search around www.microsoft.com for the Win32 SDK
Was This Post Helpful? 0
  • +
  • -

#5 quim  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 18
  • View blog
  • Posts: 182
  • Joined: 11-December 05

Re: #include <windows.h> problem

Posted 25 March 2006 - 10:45 PM

The error is saying:

Error 1 fatal error C1083: Cannot open include file: 'windows.h': No such file or directory c:\documents and settings\quim Costa\my documents\visual studio 2005\projects\march 25\march 25\main.cpp 1
By that I would say: or I wrotewindows.h wrong or VC++ could not find the windows.h header file
Do you think that if I use $(Dev-C++\include) on the VC++ directory it would work.

This post has been edited by quim: 25 March 2006 - 10:48 PM

Was This Post Helpful? 0
  • +
  • -

#6 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: #include <windows.h> problem

Posted 26 March 2006 - 07:44 AM

There is nothing wrong with your version...it is functioning as designed.

Mrafcho001 is saying that the Express edition, which you are using, may not include the win32 SDK (very likely, as the Express edition is a cut down version)...if that is the case, you will need that SDK to compile win32 programs. Since you are using the Express edition, you'll need to take some additonal steps...they are outlined here:
http://lab.msdn.micr...dk/default.aspx
Was This Post Helpful? 0
  • +
  • -

#7 quim  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 18
  • View blog
  • Posts: 182
  • Joined: 11-December 05

Re: #include <windows.h> problem

Posted 26 March 2006 - 05:51 PM

Thanks guys!

I installed Platform SDK but follow the instruction.
now my VC++ express edition is working.

This post has been edited by quim: 26 March 2006 - 05:52 PM

Was This Post Helpful? 1

Page 1 of 1