Error:windows. H already included.

Source: Internet
Author: User

This is the compiler compile order problem, you put the #include<stdafx.h> in the other included files behind. You search this file and put it all on the front.

Fatal error C1189: #error: WINDOWS. H already included. MFC Apps must not
  1. Include <windows.h>

This problem is encountered when compiling under Windows console

  1. Include "Winsock2.h"
  2. Include <afx.h>//to include this header file because it needs to use CString
  3. Include <iostream>

using namespace Std;

Later, the head file contains the position changed under the compilation by

  1. Include <afx.h>//to include this header file because it needs to use CString
  2. Include "Winsock2.h"
  3. Include <iostream>

using namespace Std;

  • This is the compiler compile order problem, you put the #include<stdafx.h> in the other included files behind. You search this file and put it all on the front.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.