编译都过不了--小师妹的简单问题
用VC写程序,将LPTSTR类型的变量转换为LPCWSTR,程序如下:
#include "atlconv.h"
....
LPTSTR fileName = "e:\\water.mpg";
LPCWSTR f = T2W(fileName);
编译时说我包含的头文件中有很多错误,这些头文件都是VC提供的,不是我自己写的,应该没问题吧
这是怎么回事?
编译信息如下:
Compiling...
player.cpp
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(48) : error C2065: '_ASSERTE' : undeclared identifier
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(237) : error C2065: 'offsetof' : undeclared identifier
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(237) : error C2275: 'DEVMODEW' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1870) : see declaration of 'DEVMODEW'
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(237) : error C2065: 'dmFormName' : undeclared identifier
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(237) : error C2275: 'DEVMODEW' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1870) : see declaration of 'DEVMODEW'
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(237) : error C2065: 'dmSpecVersion' : undeclared identifier
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(240) : error C2275: 'DEVMODEW' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1870) : see declaration of 'DEVMODEW'
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(240) : error C2065: 'dmLogPixels' : undeclared identifier
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(350) : error C2275: 'DEVMODEA' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1825) : see declaration of 'DEVMODEA'
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(350) : error C2275: 'DEVMODEA' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1825) : see declaration of 'DEVMODEA'
c:\program files\microsoft visual studio\vc98\atl\include\atlconv.h(353) : error C2275: 'DEVMODEA' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\wingdi.h(1825) : see declaration of 'DEVMODEA'
E:\vc project\player\player.cpp(210) : error C2065: '_lpa' : undeclared identifier
E:\vc project\player\player.cpp(210) : error C2440: '=' : cannot convert from 'char *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
E:\vc project\player\player.cpp(210) : error C2065: '_convert' : undeclared identifier
Error executing cl.exe.
player.obj - 14 error(s), 0 warning(s)