Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,629 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,034 people online right now. Registration is fast and FREE... Join Now!




#include <windows.h> problem

 
Reply to this topicStart new topic

#include <windows.h> problem

quim
post 25 Mar, 2006 - 05:56 PM
Post #1


D.I.C Head

Group Icon
Joined: 11 Dec, 2005
Posts: 145



Thanked 2 times

Dream Kudos: 350
My Contributions


I am learning win32 right now:
help me with this. Everytime I try to compile this program which those nothing yet.
CODE

#include <windows.h>

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


I receive this error.
CODE

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
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 25 Mar, 2006 - 06:59 PM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


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?
User is offlineProfile CardPM

Go to the top of the page

quim
post 25 Mar, 2006 - 07:16 PM
Post #3


D.I.C Head

Group Icon
Joined: 11 Dec, 2005
Posts: 145



Thanked 2 times

Dream Kudos: 350
My Contributions


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.
User is offlineProfile CardPM

Go to the top of the page

Mrafcho001
post 25 Mar, 2006 - 07:40 PM
Post #4


D.I.C Addict

Group Icon
Joined: 1 Nov, 2005
Posts: 753



Thanked 5 times

Dream Kudos: 120
My Contributions


I believe the Express editions come without the Win32 SDK.

search around www.microsoft.com for the Win32 SDK
User is offlineProfile CardPM

Go to the top of the page

quim
post 25 Mar, 2006 - 09:45 PM
Post #5


D.I.C Head

Group Icon
Joined: 11 Dec, 2005
Posts: 145



Thanked 2 times

Dream Kudos: 350
My Contributions


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 Mar, 2006 - 09:48 PM
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 26 Mar, 2006 - 06:44 AM
Post #6


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


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.microsoft.com/express/visu...dk/default.aspx
User is offlineProfile CardPM

Go to the top of the page

quim
post 26 Mar, 2006 - 04:51 PM
Post #7


D.I.C Head

Group Icon
Joined: 11 Dec, 2005
Posts: 145



Thanked 2 times

Dream Kudos: 350
My Contributions


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 Mar, 2006 - 04:52 PM
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 03:50AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month