在VC++6.0中配置WTL9.0,提示没有atlstr.h,这个文件,怎么办呢。
于是把atlmisc.h这个文件,复制一份,把名称改成atlstr.h,不就OK了。
又可使用CString 这个恶心的东西了。
编绎一下试试,提示:
error C2872: 'ATL' : ambiguous symbol 的错误。
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
CString str ;
str.Format("%s","牛牛和妙妙" );
printf("hello :%s",str);
return 0;
}
解决此问题可以修改stdafx.h
#pragma once
#include <stdio.h>
#include <tchar.h>
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#define ATL ATL9
#include <atlbase.h>
#undef ATL
namespace ATL = ::ATL9;
#include <atlapp.h>
#include <atlstr.h>
在VC++6.0中配置WTL9.0时遇到atlstr.h缺失的问题,作者尝试将atlmisc.h重命名为atlstr.h,但导致了编译错误ATL:ambiguoussymbol。为解决这个问题,作者在stdafx.h中添加了对ATL9的定义,并重新组织了命名空间,以消除编译冲突。
1161





