Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window.h not found?

Status
Not open for further replies.

merlino64bit

Programmer
Sep 29, 2006
2
FR
Hi: I've now been programming for almost a year with CodeBlocks and decided to switch to VisualC++ as I joined a team that is using it. So I install it and try to create a blank project: everything ok.

The I add this line:
#include <windows.h>


Compiler says that the file does not exist so I copy window.h to the VC++ include folder along with all the other headers i had in the CodeBlocks include folder.

I try to compile again and here's what i get:

1>------ Build started: Project: myOwn, Configuration: Debug Win32 ------
1>Compiling...
1>myOwn.cpp
1>e:\applications\microsoft visual studio 8\vc\include\winnt.h(3035) : warning C4103: 'e:\applications\microsoft visual studio 8\vc\include\winnt.h' : alignment changed after including header, may be due to missing #pragma pack(pop)
1>e:\applications\microsoft visual studio 8\vc\include\winnt.h(3327) : warning C4103: 'e:\applications\microsoft visual studio 8\vc\include\winnt.h' : alignment changed after including header, may be due to missing #pragma pack(pop)
1>e:\applications\microsoft visual studio 8\vc\include\winnt.h(3423) : warning C4068: unknown pragma
1>e:\applications\microsoft visual studio 8\vc\include\winnt.h(3428) : warning C4068: unknown pragma
1>e:\applications\microsoft visual studio 8\vc\include\winbase.h(1252) : error C2144: syntax error : 'void' should be preceded by ';'
1>e:\applications\microsoft visual studio 8\vc\include\winbase.h(1252) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>e:\applications\microsoft visual studio 8\vc\include\winbase.h(1253) : error C2144: syntax error : 'void' should be preceded by ';'
1>e:\applications\microsoft visual studio 8\vc\include\winbase.h(1253) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>e:\applications\microsoft visual studio 8\vc\include\winbase.h(1253) : error C2086: 'int DECLSPEC_NORETURN' : redefinition
1> e:\applications\microsoft visual studio 8\vc\include\winbase.h(1252) : see declaration of 'DECLSPEC_NORETURN'
1>e:\applications\microsoft visual studio 8\vc\include\winbase.h(1313) : error C2144: syntax error : 'void' should be preceded by ';'
1>e:\applications\microsoft visual studio 8\vc\include\winbase.h(1313) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>e:\applications\microsoft visual studio 8\vc\include\winbase.h(1313) : error C2086: 'int DECLSPEC_NORETURN' : redefinition
1> e:\applications\microsoft visual studio 8\vc\include\winbase.h(1252) : see declaration of 'DECLSPEC_NORETURN'
1>Build log was saved at "file://c:\Documents and Settings\Administrator\Documenti\Visual Studio 2005\Projects\myOwn\myOwn\obj\Debug\BuildLog.htm"
1>myOwn - 8 error(s), 4 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any ideas?

Thanks in advance
 
If you are using Visual C++ Express (the free version), it doesn't come automatically ready to program win32 stuff. You have to install the Microsoft Platform SDK separately to even have the windows.h header file on your computer. The website cpjust posted will show you how to download it and set up vc++ Express to be able to use it. If you already have it installed, you just need to follow the steps on setting up VC++ Express.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top