954,206 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

VC++ 6.0 errors

Hi Everyone
I am new to vc++ 6.0 graphics programming. I am getting some errors of a program which i am trying to compile. i have added all the dependencies but not able to figure out why I am getting the following errors. Any suggestions.

Threading.cpp
C:\Programming\Projects\MX - MSVC6\Threading.cpp(2118) : error C2440: 'initializing' : cannot convert from 'class std::_Tree,class std::allocator >,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocato
r >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::const_iterator' to 'class std::_Tree,class std
::allocator >,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator
>,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::iterator'
No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Programming\Projects\MX - MSVC6\Threading.cpp(2119) : error C2678: binary '!=' : no operator defined which takes a left-hand operand of type 'class std::_Tree,class std::allocator
>,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,s
truct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::
allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator<
char> > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn
,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_Performan
ceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::iterator' (or there is no acceptable conversion)
C:\Programming\Projects\MX5 - MSVC6\Threading.cpp(2137) : error C2440: 'initializing' : cannot convert from 'class std::_Tree,class std::allocator >,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocato
r >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::const_iterator' to 'class std::_Tree,class std
::allocator >,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator
>,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::iterator'
No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Programming\Projects\MX - MSVC6\Threading.cpp(2138) : error C2678: binary '!=' : no operator defined which takes a left-hand operand of type 'class std::_Tree,class std::allocator
>,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,s
truct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::
allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator<
char> > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn
,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_Performan
ceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::iterator' (or there is no acceptable conversion)
C:\Programming\Projects\MX - MSVC6\Threading.cpp(2157) : error C2440: 'initializing' : cannot convert from 'class std::_Tree,class std::allocator >,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocato
r >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::const_iterator' to 'class std::_Tree,class std
::allocator >,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator
>,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::iterator'
No constructor could take the source type, or constructor overload resolution was ambiguous
C:\Programming\Projects\MX - MSVC6\Threading.cpp(2158) : error C2678: binary '!=' : no operator defined which takes a left-hand operand of type 'class std::_Tree,class std::allocator
>,struct std:[IMG]http://forums.microsoft.com/MSDN/emoticons/emotion-4.gif[/IMG]air,class std::allocator > const ,class std::map,class std::allocator >,class c_PerformanceMeasurement,s
truct std::less,class std::allocator > >,class std::allocator > >,struct std::map,class std::
allocator >,class std::map,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator<
char> > >,class std::allocator >,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_PerformanceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::_Kfn
,struct std::less,class std::allocator > >,class std::allocator,class std::allocator >,class c_Performan
ceMeasurement,struct std::less,class std::allocator > >,class std::allocator > > >::iterator' (or there is no acceptable conversion)
C:\Programming\Projects\MX - MSVC6\Threading.cpp(2158) : fatal error C1903: unable to recover from previous error(s); stopping compilation
TimeManager.cpp
Transitions.cpp
Utilities.cpp
Utilities_ATL.cpp
Utilities_FilterGraph.cpp
Error executing cl.exe.
MX.exe - 7 error(s), 0 warning(s)

avi_new
Newbie Poster
3 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

my guess is that you forgot to include one or more header files. You should post the line(s) the compiler is complaining about.

Ancient Dragon
Retired & Loving It
Team Colleague
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
 

All the errors are from these codes. I have no clue why? Thanks in advance.

std::map<std::string, std::map<std::string, c_PerformanceMeasurement> >::iterator iClass = mPerformances.find(Class);
if (iClass != mPerformances.end())
 {
  std::map<std::string, c_PerformanceMeasurement>::iterator iPerformance = iClass->second.find(Name);
  if (iPerformance != iClass->second.end())
  {
   return iPerformance->second;
  }
 }
avi_new
Newbie Poster
3 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

does second.find(Name); return an iterator of the correct type? such as std::map::

Ancient Dragon
Retired & Loving It
Team Colleague
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
 

All the errors are from these codes. I have no clue why? Thanks in advance.

std::map<std::string, std::map<std::string, c_PerformanceMeasurement> >::iterator iClass = mPerformances.find(Class);
if (iClass != mPerformances.end())
 {
  std::map<std::string, c_PerformanceMeasurement>::iterator iPerformance = iClass->second.find(Name);
  if (iPerformance != iClass->second.end())
  {
   return iPerformance->second;
  }
 }


looks like the variablemPerformances is a const map<...
you have to change ...>::iterator to ...>::const_iterator

vijayan121
Posting Virtuoso
1,606 posts since Dec 2006
Reputation Points: 1,159
Solved Threads: 287
 
does second.find(Name); return an iterator of the correct type? such as std::map::



Yes, it does. Actually, this code is developed by one of the developer of my company. The code runs ok in his machine. But when I try to compile it in my machine, it gives me error. I made sure that all the settings are same as his but same old errors. any suggestions?

avi_new
Newbie Poster
3 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 
. any suggestions?

try vijayan's succestion :)

>>The code runs ok in his machine
And I've heard/said that one a million times too :D

Ancient Dragon
Retired & Loving It
Team Colleague
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You