Archived

This topic is now archived and is closed to further replies.

Stl problem with <hash_map>

This topic is 5433 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m still pretty new to using the Stl library, so this may be a stupid question: I''ve been getting on fine with the lib included in Visual C++, but now I need to compile someone elses project that happens to use . From what I can make out, this isnt actually a standard class but part of Sgi''s version of the Stl. So I downloaded Sgi''s version and (wrongly it appears) assumed I could just extract it into my VC98\include folder to get it all to work. Unfortunatly, this still doesn''t allow it to compile, throwing up:
  
E:\My Stuff\PeaSoup\PSoup\ChildView.cpp(124) : error C2819: type ''std::_Rb_tree_iterator<struct std::pair<long const ,class Organism *>,struct std::pair<long const ,class Organism *> &,struct std::pair<long const ,class Organism *> *>'' does not have an overloaded member ''operator ->''  
And umpteen other errors (104!) A sample of which:
  d:\visual studio\vc98\include\xiosbase(106) : error C2146: syntax error : missing '';'' before identifier ''precision''
d:\visual studio\vc98\include\xiosbase(106) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xiosbase(107) : warning C4183: ''precision'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xiosbase(108) : error C2146: syntax error : missing '';'' before identifier ''precision''
d:\visual studio\vc98\include\xiosbase(108) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xiosbase(111) : warning C4183: ''precision'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xiosbase(112) : error C2146: syntax error : missing '';'' before identifier ''width''
d:\visual studio\vc98\include\xiosbase(112) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xiosbase(113) : warning C4183: ''width'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xiosbase(114) : error C2146: syntax error : missing '';'' before identifier ''width''
d:\visual studio\vc98\include\xiosbase(114) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xiosbase(114) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\xiosbase(117) : warning C4183: ''width'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(23) : error C2065: ''allocator'' : undeclared identifier
        d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(23) : error C2275: ''_E'' : illegal use of this type as an expression
        d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(23) : error C2059: syntax error : ''>''  
Which to me suggests that I''ve either not installed the library properly, or that its just plain incompatible.. Anyone any ideas? Oh, and I''d much rather not change the code to use something else that hash_map, but I''m not sure how much work that would be.. Thanks in advance

Share this post


Link to post
Share on other sites
You should put the library it''s own directory, wherever you want on your system.

Then set up your environment so it knows about it. In vc++6.0 this means Tools->Options->Directories. Put the path to the new libraries above the microsoft ones in the list (you can move stuff up and down using the arrows). Then it will be searched first when trying to find the stl stuff.

Share this post


Link to post
Share on other sites
Thanks, I''ve done that and it seems to be including the new dir properly now, but it still kicks up all the same errors I don''t understand why the errors in vc98\include\xiosbase start turning up at all..

Snippits of code which cause the first couple of errors:

  
World::Organisms OrgCollection;
World::OrganismsIterator it;
OrgCollection = world.GetOrganismCollection();
Organism * currentOrg;

for (it = OrgCollection.begin(); it != OrgCollection.end(); it++)
{
currentOrg = it->second;
if (currentOrg!=NULL)
{
HICON hIcon = currentOrg->GetIcon();

// Draw Icon

MemDC.DrawIcon( currentOrg->GetCoord().GetXPos()*iXFactor, currentOrg->GetCoord().GetYPos()*iYFactor, hIcon);
}
}


With typedefs:

      // Organism List

typedef std::map<long, Organism*> Organisms;
// typedef std::

typedef Organisms::iterator OrganismsIterator;

// Organism vector

typedef std::vector<long> OrganismIDCollection;
typedef OrganismIDCollection::iterator OrganismIDCollectionIterator;

// Landscape Map

typedef std::map<Coord, OrganismIDCollection> LandscapeOrganismMap;
typedef LandscapeOrganismMap::iterator LandscapeOrganismMapIterator;

typedef pair <Coord, OrganismIDCollection> Coord_Pair;


The complete error report, just in case that helps:

  Compiling...
ChildView.cpp
E:\My Stuff\PeaSoup\PSoup\ChildView.cpp(124) : error C2819: type ''std::_Rb_tree_iterator<struct std::pair<long const ,class Organism *>,struct std::pair<long const ,class Organism *> &,struct std::pair<long const ,class Organism *> *>'' does not have
an overloaded member ''operator ->''
E:\My Stuff\PeaSoup\PSoup\ChildView.cpp(124) : error C2227: left of ''->second'' must point to class/struct/union
World.cpp
d:\visual studio\vc98\include\xiosbase(106) : error C2146: syntax error : missing '';'' before identifier ''precision''
d:\visual studio\vc98\include\xiosbase(106) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xiosbase(107) : warning C4183: ''precision'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xiosbase(108) : error C2146: syntax error : missing '';'' before identifier ''precision''
d:\visual studio\vc98\include\xiosbase(108) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xiosbase(111) : warning C4183: ''precision'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xiosbase(112) : error C2146: syntax error : missing '';'' before identifier ''width''
d:\visual studio\vc98\include\xiosbase(112) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xiosbase(113) : warning C4183: ''width'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xiosbase(114) : error C2146: syntax error : missing '';'' before identifier ''width''
d:\visual studio\vc98\include\xiosbase(114) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xiosbase(114) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\xiosbase(117) : warning C4183: ''width'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(23) : error C2065: ''allocator'' : undeclared identifier
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(23) : error C2275: ''_E'' : illegal use of this type as an expression
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(23) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(24) : error C2238: unexpected token(s) preceding '';''
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(33) : error C2146: syntax error : missing '';'' before identifier ''falsename''
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(33) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(34) : warning C4183: ''falsename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(35) : error C2146: syntax error : missing '';'' before identifier ''truename''
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(35) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(36) : warning C4183: ''truename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2146: syntax error : missing '';'' before identifier ''do_falsename''
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2433: ''string_type'' : ''virtual'' not permitted on data declarations
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(63) : warning C4183: ''do_falsename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2146: syntax error : missing '';'' before identifier ''do_truename''
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2433: ''string_type'' : ''virtual'' not permitted on data declarations
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(65) : warning C4183: ''do_truename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation ''std::numpunct<_E>'' being compiled
d:\visual studio\vc98\include\xlocnum(96) : error C2275: ''_E'' : illegal use of this type as an expression
d:\visual studio\vc98\include\xlocnum(412) : see reference to class template instantiation ''std::num_get<_E,_II>'' being compiled
d:\visual studio\vc98\include\xlocnum(96) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\xlocnum(412) : see reference to class template instantiation ''std::num_get<_E,_II>'' being compiled
d:\visual studio\vc98\include\xlocnum(97) : error C2238: unexpected token(s) preceding '';''
d:\visual studio\vc98\include\xlocnum(412) : see reference to class template instantiation ''std::num_get<_E,_II>'' being compiled
d:\visual studio\vc98\include\xlocnum(421) : error C2275: ''_E'' : illegal use of this type as an expression
d:\visual studio\vc98\include\xlocnum(639) : see reference to class template instantiation ''std::num_put<_E,_OI>'' being compiled
d:\visual studio\vc98\include\xlocnum(421) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\xlocnum(639) : see reference to class template instantiation ''std::num_put<_E,_OI>'' being compiled
d:\visual studio\vc98\include\xlocnum(422) : error C2238: unexpected token(s) preceding '';''
d:\visual studio\vc98\include\xlocnum(639) : see reference to class template instantiation ''std::num_put<_E,_OI>'' being compiled
d:\visual studio\vc98\include\xlocnum(23) : error C2275: ''_E'' : illegal use of this type as an expression
d:\visual studio\vc98\include\xlocnum(21) : see declaration of ''_E''
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(23) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(24) : error C2238: unexpected token(s) preceding '';''
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(33) : error C2146: syntax error : missing '';'' before identifier ''falsename''
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(33) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(34) : warning C4183: ''falsename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(35) : error C2146: syntax error : missing '';'' before identifier ''truename''
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(35) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(36) : warning C4183: ''truename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2146: syntax error : missing '';'' before identifier ''do_falsename''
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2433: ''string_type'' : ''virtual'' not permitted on data declarations
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(63) : warning C4183: ''do_falsename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2146: syntax error : missing '';'' before identifier ''do_truename''
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2433: ''string_type'' : ''virtual'' not permitted on data declarations
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(65) : warning C4183: ''do_truename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(646) : see reference to class template instantiation ''std::numpunct<char>'' being compiled
d:\visual studio\vc98\include\xlocnum(23) : error C2275: ''_E'' : illegal use of this type as an expression
d:\visual studio\vc98\include\xlocnum(21) : see declaration of ''_E''
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(23) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(24) : error C2238: unexpected token(s) preceding '';''
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(33) : error C2146: syntax error : missing '';'' before identifier ''falsename''
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(33) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(34) : warning C4183: ''falsename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(35) : error C2146: syntax error : missing '';'' before identifier ''truename''
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(35) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(36) : warning C4183: ''truename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2146: syntax error : missing '';'' before identifier ''do_falsename''
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2433: ''string_type'' : ''virtual'' not permitted on data declarations
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(62) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(63) : warning C4183: ''do_falsename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2146: syntax error : missing '';'' before identifier ''do_truename''
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2433: ''string_type'' : ''virtual'' not permitted on data declarations
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(64) : error C2501: ''string_type'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(65) : warning C4183: ''do_truename'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\xlocnum(647) : see reference to class template instantiation ''std::numpunct<unsigned short>'' being compiled
d:\visual studio\vc98\include\xlocnum(649) : error C2065: ''istreambuf_iterator'' : undeclared identifier
d:\visual studio\vc98\include\xlocnum(649) : error C2062: type ''char'' unexpected
d:\visual studio\vc98\include\xlocnum(649) : error C2976: ''num_get'' : too few template arguments
d:\visual studio\vc98\include\xlocnum(412) : see declaration of ''num_get''
d:\visual studio\vc98\include\xlocnum(649) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\xlocnum(651) : error C2275: ''wchar_t'' : illegal use of this type as an expression
d:\visual studio\vc98\include\ctype.h(60) : see declaration of ''wchar_t''
d:\visual studio\vc98\include\xlocnum(651) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\xlocnum(653) : error C2065: ''ostreambuf_iterator'' : undeclared identifier
d:\visual studio\vc98\include\xlocnum(653) : error C2062: type ''char'' unexpected
d:\visual studio\vc98\include\xlocnum(653) : error C2976: ''num_put'' : too few template arguments
d:\visual studio\vc98\include\xlocnum(639) : see declaration of ''num_put''
d:\visual studio\vc98\include\xlocnum(653) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\xlocnum(655) : error C2275: ''wchar_t'' : illegal use of this type as an expression
d:\visual studio\vc98\include\ctype.h(60) : see declaration of ''wchar_t''
d:\visual studio\vc98\include\xlocnum(655) : error C2059: syntax error : ''>''
d:\visual studio\vc98\include\streambuf(44) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(53) : error C2146: syntax error : missing '';'' before identifier ''in_avail''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(53) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(55) : warning C4183: ''in_avail'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(64) : error C2146: syntax error : missing '';'' before identifier ''sgetn''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(64) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(64) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(65) : warning C4183: ''sgetn'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(86) : error C2146: syntax error : missing '';'' before identifier ''sputn''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(86) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(86) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(87) : warning C4183: ''sputn'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(143) : error C2146: syntax error : missing '';'' before identifier ''xsgetn''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(143) : error C2433: ''streamsize'' : ''virtual'' not permitted on data declarations
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(143) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(143) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(156) : warning C4183: ''xsgetn'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(157) : error C2146: syntax error : missing '';'' before identifier ''xsputn''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(157) : error C2433: ''streamsize'' : ''virtual'' not permitted on data declarations
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(157) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(157) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(170) : warning C4183: ''xsputn'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(177) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(191) : see reference to class template instantiation ''std::basic_streambuf<_E,_Tr>'' being compiled
d:\visual studio\vc98\include\streambuf(30) : error C2039: ''pos_type'' : is not a member of ''char_traits<char>''
e:\my stuff\c++\stl\stl 3_3\char_traits.h(116) : see declaration of ''char_traits<char>''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(30) : error C2146: syntax error : missing '';'' before identifier ''pos_type''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(30) : error C2868: ''pos_type'' : illegal syntax for using-declaration; expected qualified-name
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(31) : error C2039: ''off_type'' : is not a member of ''char_traits<char>''
e:\my stuff\c++\stl\stl 3_3\char_traits.h(116) : see declaration of ''char_traits<char>''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(31) : error C2146: syntax error : missing '';'' before identifier ''off_type''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(31) : error C2868: ''off_type'' : illegal syntax for using-declaration; expected qualified-name
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(44) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(53) : error C2146: syntax error : missing '';'' before identifier ''in_avail''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(53) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(54) : warning C4183: ''in_avail'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(64) : error C2146: syntax error : missing '';'' before identifier ''sgetn''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(64) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(64) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(65) : warning C4183: ''sgetn'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(86) : error C2146: syntax error : missing '';'' before identifier ''sputn''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(86) : error C2501: ''streamsize'' : missing storage-class or type specifiers
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(86) : error C2061: syntax error : identifier ''streamsize''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(87) : warning C4183: ''sputn'': member function definition looks like a ctor, but name does not match enclosing class
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(143) : error C2146: syntax error : missing '';'' before identifier ''xsgetn''
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
d:\visual studio\vc98\include\streambuf(143) : fatal error C1003: error count exceeds 100; stopping compilation
d:\visual studio\vc98\include\streambuf(195) : see reference to class template instantiation ''std::basic_streambuf<char,class std::char_traits<char> >'' being compiled
Generating Code...
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file ''.\Debug\World.sbr'': No such file or directory
Error executing bscmake.exe.

PeaSoup.exe - 105 error(s), 24 warning(s)

Share this post


Link to post
Share on other sites
I''m guessing you''re doing something similar to this:


  
struct Foo {
int a, b;
}
vector<Foo> foos;
// put stuff in foos

vector<Foo>::iterator fooIter = foos.begin();
foo myFoo;
*fooIter = myFoo; // this is all right

fooIter->a = 3; // THIS IS NOT

(*fooIter).a = 3; // the proper way to do it

[source]

Ya see? Iterators look like pointers, but they aren''t really. They don''t have an arrow operator. Use the dereference operator instead, and the dot operator. But don''t forget the parentheses.



Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
Hmm, odd, I thought that the iterators had an overloaded ''->'' operator for such use. So I changed the code as you mentioned Sneftel, and it removed the first two errors Unfortunatly, the rest still remain. I think perhaps a reinstall of VC++ may be in order..

Share this post


Link to post
Share on other sites