标头c ++ [英] Headers c++

查看:77
本文介绍了标头c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何正确设置标题?
我在某处干ed,如果将标题正确排列,将不会有下一个问题:

How to put the headers in right order?
I reed somewhere that if I put the headers in right order I will not have the next problems:

1>------ Build started: Project: save-keyboard-console-2, Configuration: Debug Win32 ------
1>  save-keyboard-console-2.cpp
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(46): error C2146: syntax error : missing '';'' before identifier ''HDWP''
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(47): error C2146: syntax error : missing '';'' before identifier ''MENUTEMPLATEA''
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(47): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(47): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(54): error C2146: syntax error : missing '';'' before identifier ''LPMENUTEMPLATEA''
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(62): error C2065: ''CALLBACK'' : undeclared identifier
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(62): error C2065: ''WNDPROC'' : undeclared identifier
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(62): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v7.0a\include\winuser.h(62): fatal error C1903: unable to recover from previous error(s); stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



标头:



The headers:

#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <Winuser.h>



如果不是问题,则标题可帮助我解决这些问题.谢谢.



If the problem aren''t the headers help me to fix these problems. Thanks.

推荐答案

我认为您的问题不在#include顺序中:尝试将#include <WinUser.h>替换为#include <Windows.h>.这可能会解决您的问题.
I think that your problem is not in the #include order: try replacing #include <WinUser.h> with #include <Windows.h>. This probably will fix your problem.


这篇关于标头c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆