Click here to Skip to main content
15,893,904 members
Please Sign up or sign in to vote.
2.20/5 (5 votes)
See more:
I get this error while compile:

XML
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(195) : warning C4346: 'ATL::ChTraitsBase<BaseType>::XCHAR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(750) : see reference to class template instantiation 'ATL::CSimpleStringT<BaseType>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(195) : error C2146: syntax error : missing ';' before identifier 'XCHAR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(195) : error C2501: 'ATL::CSimpleStringT<BaseType>::XCHAR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(196) : warning C4346: 'ATL::ChTraitsBase<BaseType>::PXSTR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(196) : error C2146: syntax error : missing ';' before identifier 'PXSTR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(196) : error C2501: 'ATL::CSimpleStringT<BaseType>::PXSTR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(197) : warning C4346: 'ATL::ChTraitsBase<BaseType>::PCXSTR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(197) : error C2146: syntax error : missing ';' before identifier 'PCXSTR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(197) : error C2501: 'ATL::CSimpleStringT<BaseType>::PCXSTR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(198) : warning C4346: 'ATL::ChTraitsBase<BaseType>::YCHAR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(198) : error C2146: syntax error : missing ';' before identifier 'YCHAR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(198) : error C2501: 'ATL::CSimpleStringT<BaseType>::YCHAR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(199) : warning C4346: 'ATL::ChTraitsBase<BaseType>::PYSTR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(199) : error C2146: syntax error : missing ';' before identifier 'PYSTR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(199) : error C2501: 'ATL::CSimpleStringT<BaseType>::PYSTR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(200) : warning C4346: 'ATL::ChTraitsBase<BaseType>::PCYSTR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(200) : error C2146: syntax error : missing ';' before identifier 'PCYSTR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(200) : error C2501: 'ATL::CSimpleStringT<BaseType>::PCYSTR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(216) : error C2146: syntax error : missing ')' before identifier 'pszSrc'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(216) : error C2146: syntax error : missing ';' before identifier 'pszSrc'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(216) : error C2501: 'ATL::CSimpleStringT<BaseType>::pszSrc' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(216) : error C2143: syntax error : missing ';' before '*'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(216) : error C2501: 'ATL::CSimpleStringT<BaseType>::IAtlStringMgr' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(216) : error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(216) : error C2501: 'ATL::CSimpleStringT<BaseType>::pStringMgr' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(218) : error C2059: syntax error : 'constant'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(218) : error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(218) : error C2238: unexpected token(s) preceding ';'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(220) : error C2864: 'nLength' : only const static integral data members can be initialized inside a class or struct
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(221) : error C2864: 'pData' : only const static integral data members can be initialized inside a class or struct
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(222) : error C2059: syntax error : 'if'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(223) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(226) : error C2061: syntax error : identifier 'pData'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(226) : warning C4183: 'Attach': missing return type; assumed to be a member function returning 'int'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(227) : error C2061: syntax error : identifier 'nLength'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(227) : warning C4183: 'SetLength': missing return type; assumed to be a member function returning 'int'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(228) : error C2061: syntax error : identifier 'm_pszData'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(228) : warning C4183: 'CopyChars': missing return type; assumed to be a member function returning 'int'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(230) : error C2146: syntax error : missing ';' before identifier 'CSimpleStringT'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(757) : warning C4346: 'ATL::CSimpleStringT<BaseType>::XCHAR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(825) : see reference to class template instantiation 'ATL::CStrBufT<TCharType>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(757) : error C2146: syntax error : missing ';' before identifier 'XCHAR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(757) : error C2501: 'ATL::CStrBufT<TCharType>::XCHAR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(758) : warning C4346: 'ATL::CSimpleStringT<BaseType>::PXSTR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(758) : error C2146: syntax error : missing ';' before identifier 'PXSTR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(758) : error C2501: 'ATL::CStrBufT<TCharType>::PXSTR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(759) : warning C4346: 'ATL::CSimpleStringT<BaseType>::PCXSTR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(759) : error C2146: syntax error : missing ';' before identifier 'PCXSTR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(759) : error C2501: 'ATL::CStrBufT<TCharType>::PCXSTR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(797) : error C2833: 'operator PXSTR' is not a recognized operator or type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(797) : error C2059: syntax error : 'newline'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(798) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(801) : error C2833: 'operator PCXSTR' is not a recognized operator or type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(801) : error C2059: syntax error : 'newline'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(802) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(815) : error C2146: syntax error : missing ';' before identifier 'm_pszBuffer'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(815) : error C2501: 'ATL::CStrBufT<TCharType>::PXSTR' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlsimpstr.h(815) : error C2501: 'ATL::CStrBufT<TCharType>::m_pszBuffer' : missing storage-class or type specifiers
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(767) : error C2226: syntax error : unexpected type 'ATL::CStringT<BaseType,StringTraits>'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2131) : see reference to class template instantiation 'ATL::CStringT<BaseType,StringTraits>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(767) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(787) : error C2226: syntax error : unexpected type 'ATL::CStringT<BaseType,StringTraits>'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(787) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(850) : error C2059: syntax error : ''
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(850) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(855) : error C2226: syntax error : unexpected type 'ATL::IAtlStringMgr'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(855) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(860) : error C2059: syntax error : ''
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(860) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(874) : error C2226: syntax error : unexpected type 'ATL::IAtlStringMgr'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(874) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(908) : error C2327: 'ATL::CSimpleStringT<BaseType>::PCXSTR' : is not a type name, static, or enumerator
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(908) : error C2061: syntax error : identifier 'PCXSTR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(909) : error C2805: binary 'operator =' has too few parameters
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(909) : error C2333: 'ATL::CStringT<BaseType,StringTraits>::operator`='' : error in function declaration; skipping function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(915) : error C2061: syntax error : identifier 'PCYSTR'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(918) : error C2864: 'nDestLength' : only const static integral data members can be initialized inside a class or struct
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(919) : error C2059: syntax error : 'if'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(920) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(925) : error C2059: syntax error : 'else'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(926) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(930) : error C2059: syntax error : 'return'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(930) : error C2238: unexpected token(s) preceding ';'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(933) : error C2146: syntax error : missing ';' before identifier 'CStringT'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2308) : warning C4346: 'StringType::XCHAR' : dependent name is not a type
        prefix with 'typename' to indicate a type
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2371) : see reference to class template instantiation 'ATL::CFixedStringT<StringType,t_nChars>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2308) : error C2143: syntax error : missing ')' before '*'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2308) : error C2143: syntax error : missing ';' before '*'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2308) : error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2309) : error C2065: 'm_data' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2309) : error C2653: 'StrTraits' : is not a class or namespace name
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2309) : error C3861: 'GetDefaultManager': identifier not found, even with argument-dependent lookup
C:\Program Files (x86)\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h(2309) : fatal error C1903: unable to recover from previous error(s); stopping compilation



Is there a workaround for this?

In advance, thanks!
Posted
Comments
walterhevedeich 13-May-11 5:44am    
wow. thats a long error trail. So you're expecting everyone to go through the error message and provide you a solution, without you providing a background of the issue?
Sergey Alexandrovich Kryukov 13-May-11 6:05am    
You're right. It's so outrageous so I decided to post a "solution", please see.
--SA

I think Albert is close to the real problem.

In my opinion, these errors come from some bad project settings. You are obviously using MFC libraries but your project settings somehow changed. My guess is: you created a new project (maybe non-MFC project) and copy/pasted code from another one which settings were different (the previous one was an MFC project).

I suggest you create a fresh new MFC project, make sure it compiles before adding your code, and your files one by one. You may use a diff utility to check the differences between files/directories (I personnaly like this one: http://winmerge.org/[^])
 
Share this answer
 
Comments
Albert Holguin 13-May-11 11:41am    
Good answer and advice! my 4... :p
Sergey Alexandrovich Kryukov 13-May-11 12:48pm    
Agree, my 5.
--SA
Nithin Sundar 15-May-11 22:48pm    
My 5! Good answer!
All these errors seem to be coming from one of the installed libraries, looks like you have some error with include order, you're missing some necessary includes, or possibly have included incompatible libraries (such as two versions of the same thing). The more likely scenario here is the missing include or having includes out of order.
 
Share this answer
 
Comments
Olivier Levrey 13-May-11 11:40am    
I think you are close to OP's problem. I added my own advices. I voted 4.
Sergey Alexandrovich Kryukov 13-May-11 12:47pm    
Very good, my 5.
--SA
Albert Holguin 13-May-11 13:08pm    
thank you SA
Nithin Sundar 15-May-11 22:48pm    
5! Spot on!
Be reasonable. Walterhevedeich is quite right. This is beyond any reason. This is nearly asking to do your job. Come to some acceptable level which would make asking your questions here at CodeProject a bit more sensible. Right now, it does not make sense. After all, hire some tutor. Honestly…

—SA
 
Share this answer
 
Comments
walterhevedeich 13-May-11 6:13am    
Amen. :)
Sergey Alexandrovich Kryukov 13-May-11 6:27am    
}-)=
Olivier Levrey 13-May-11 11:48am    
Your remark about posting so many errors is OK, but I think OP won't be able to solve his problem without a few ideas. Please see Albert's answer and mine.
Sergey Alexandrovich Kryukov 13-May-11 12:51pm    
Nothing wrong about posting the comment about informing me about it. Thank you. :-)
I nevertheless think such question is not quite adequate.
As to your answers, I already voted -- they are good. Good job, should be really helpful.
--SA
Olivier Levrey 16-May-11 3:35am    
Thank you SA.
You seem to have too many syntax errors. Correct them all (they are simple to correct. All you need to do is spend some valuable time looking through your code) and then post the PART of your code where you think it is going wrong. Do not post the error list or your full program's code as people will only get fed up looking through it.
 
Share this answer
 
Comments
walterhevedeich 13-May-11 6:13am    
Good advice. voted 5.
Albert Holguin 13-May-11 11:09am    
See my solution, maybe we need to spend some more valuable time looking at what the OP posted instead of jumping to conclusions.
Nithin Sundar 15-May-11 22:47pm    
My bad! You are correct!
Albert Holguin 15-May-11 23:37pm    
no worries, i think everyone saw the long list of errors and didn't bother to look at the file it was from... an installed library
Please, don't do that... this amount of errors without something to follow is only useful for getting downvotes and to make us to ignore your post...

My best advice here: remove parts of the code using comments and try to separate and locate the errors... Post some code and then possibly somebody will help you...

:thumbsdown:
 
Share this answer
 
Comments
Albert Holguin 13-May-11 11:08am    
Those errors aren't coming from his code, see my solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900