"Jacky Yuk" <ja*******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Hi all,
I am new to c++ but using c for long time. Recently, I created a MFC
GUI project by VC/C++ 6.0. Everything was fine until I wanted to use
"template":
template <typename T>
class AutoComPtr { ...
The following errors were shown:
.\external\include\autocom.hpp(18) : error C2059: syntax error : '>'
.\external\include\autocom.hpp(62) : error C2992: 'AutoComPtr' :
invalid or missing template parameter list
.\external\include\autocom.hpp(62) : see declaration of
'AutoComPtr'
.\external\include\autocom.hpp(67) : error C2059: syntax error : '>'
Furthermore, I even can't include "<iostream>" (but "iostream.h"). It
gave the following errors in the file "iosfwd":
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(215) :
error C2079: '$S202' uses undefined class '$S202'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(215) :
error C2143: syntax error : missing ',' before 'constant'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(260) :
error C2975: 'allocator' : invalid template argument for '$S202',
constant expression expected
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(216) : see
declaration of 'allocator'
Could anyone tell me what're the error about. Thanks so much.
Best Regards,
Jacky
Although you should upgrade to more standard-compliant compilers (e.g.
VC7.1), the error is most likely caused by your code. It could be a typo or
something more serious. Perhaps posting the lines where errors occur might
give us more clue to help you help yourself.
Ben