Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WINDOWS.H already included error


I get an error when trying to compile a small c++ program
Error 87 fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxv_w32.h 16

I made sure that the windows.h was not included in any of the project files I have. I am using a visual studio 2008 IDE

Any reason why ?

like image 543
coderGeorge Avatar asked Mar 22 '11 13:03

coderGeorge


People also ask

What is include window h?

h is a Windows-specific header file for the C and C++ programming languages which contains declarations for all of the functions in the Windows API, all the common macros used by Windows programmers, and all the data types used by the various functions and subsystems.

Why Windows H is not working?

h'". That problem happens because the file, which is needed to compile programs that make calls to the Windows operating system, is not installed. To fix this, download and install the Microsoft Windows SDK for your system (it is free).

What does Windows h do in Word?

To start dictating, select a text field and press the 'Windows logo key' +' H' to open the dictation toolbar. Just start speaking and it creates text from your voice. If you pause for a few seconds you may have to select the dictation icon in the dictation toolbar.

Why we use #include Windows h in C program?

<windows. h> header file is used to access the Win32 API functions and it makes it easier for the user to use the in-built functionality. - The header file in particular includes the library and functions used in the libraries like stdio.


1 Answers

try and include afxcoll.h before stdafx.h. I had the same problem and it fixed it. See http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/2ab6862f-0d90-467a-b283-f62f6aef96fe/ for the original discussion.

like image 174
zuuz Avatar answered Oct 20 '22 01:10

zuuz