wtl : 编译问题

来源:互联网 发布:畅捷通软件不好用 编辑:程序博客网 时间:2024/05/18 22:55

试验采用的环境是 : wtl8.1 + vs2010

使用 BEGIN_MSG_MAP_EX 时编译不过

// stdafx.h : include file for standard system include files,//  or project specific include files that are used frequently, but//  are changed infrequently//#pragma once// Change these values to use different versions// #define WINVER0x0500// #define _WIN32_WINNT0x0501// #define _WIN32_IE0x0501// #define _RICHEDIT_VER0x0200#include <atlbase.h>#include <atlapp.h>#include <atlcrack.h> ///< for BEGIN_MSG_MAP_EX, need atlapp.hextern CAppModule g_AppModule; ///< need atlapp.h#include <atlwin.h>#include <atlframe.h>#include <atlctrls.h>#include <atldlgs.h>

工程自包含WTL的工程设置

建立工程后,没有选建立新的工程目录。
将wtl的包含文件夹放到和sln同级目录的inc/wtl中

当编译时,会出现2种编译错误。解决方法:分别包含wtl头文件路径如下.

\testwtlrcincludeerr\stdafx.h(15): fatal error C1083: Cannot open include file: 'atlapp.h': No such file or directory

add below to properties => Configuration Properties => c/c++ => General => additional include Directories.
./inc/wtl/

.rc
1>testWtlRcIncludeErr.rc(10): fatal error RC1015: cannot open include file 'atlres.h'.

add below to properties => Configuration Properties => Resources => General => Additional Include Directories
./inc/wtl/

记得在一个商用工程中,将wtl头文件直接甩到vc10/atlmfc目录下。
被甲方的项目经理质问过,当时没有深究这个问题。

显然,放到工程目录下自包含,好处是明显的.


0 0
原创粉丝点击