使用 Visual C++ Express 2010 时找不到 atlbase.h [英] atlbase.h not found when using Visual C++ Express 2010
问题描述
因此,我尝试将我的项目从 Windows XP 上的先前版本移至 Windows 7 上的 Visual C++ Express 2010.我遇到了各种找不到 atlbase.h 的错误.这不是一个问题,但我想记录下我对他人的决心.
So I tried moving my project to Visual C++ Express 2010 on Windows 7 from a previous version on Windows XP. I got all sorts of errors where atlbase.h was not found. This isn't so much a question but I wanted to document what my resolution was for others.
从我之前的安装中复制以下 PlatformSDK 文件并将它们放在我的 Windows 7 机器上.
Copied the following PlatformSDK files from my previous install and put them on my Windows 7 machine.
PlatformSDK/include/atl
PlatformSDK/include/atl
PlatformSDK/include/mfc
PlatformSDK/include/mfc
平台SDK/lib
平台SDK/src/atl
PlatformSDK/src/atl
然后我将项目属性中的 VC++ 目录更改为指向这些目录.
I then change the VC++ Directories in the project Properties to point to those directories.
包括目录-
*包括/atl
*包括/mfc
库目录-
*lib
源目录-
*src/atl
对 stdafx.h 进行更改
Make a change to stdafx.h
在这一行之后:#include "atlbase.h"
right after this line: #include "atlbase.h"
添加这一行:extern CComModule _Module;
add this line: extern CComModule _Module;
希望你现在准备好了!可能不是,但也许你已经在路上了.
Hopefully you're ready to go now! Probably not but perhaps you are well on your way.
推荐答案
ATL 和 MFC 未包含在 Visual Studio 的免费 Express 版本中.这是定位包含文件出现问题的主要原因.ATL 仍然是 WDK 的一部分.如果您的 ATL 与以前版本的 VS 或 WDK 没有安装,则需要分别进入项目设置更新您的包含目录,以便获取 ATL *.h 文件.有关更多详细信息和讨论,请参阅下面的帖子.
ATL and MFC were not included into free Express versions of Visual Studio. This is the primary reason behind the problems locating the include file. ATL still is is part WDK. If you have ATL isntalled with a previous version of VS, or with WDK, you need to go to project setting an update your includ directories respectively, so that ATL *.h files are picked up. See post below for more details and discussion.
- 如何添加 WTL 和ATL 到 Visual Studio C++ express 2008
- 为什么是 MFC、ATL 和 masm 未包含在 VC++ Express 中?
- 请将 ATL 包含到 VC++2010 Express 或 Windows SDK
这篇关于使用 Visual C++ Express 2010 时找不到 atlbase.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!