www.digitalmars.com         C & C++   DMDScript  

c++.stl.port - Unexpected OPTLINK Termination when using hash_map and ifstream

reply Phil Thompson <phil electricvisions.com> writes:
I seem to have found a problem that I've narrowed down somewhat.

#include <string>
#include <fstream>
#include <hash_map>

int main(int argc, char *argv[])
{
	std::ifstream inputStream;
	std::hash_map<std::string, std::string> hashMap;

	return 0;
}

Attempting to compile and link the preceeding code causes the error 
mentioned in the subject.

* If you remove the code the error does not occur
* If you change hash_map to use map the error goes away
* If you change either of the template arguments from std::string to int 
the error goes away

I could probably get away with using map instead of hash_map for the 
time being but I thought it would be worth mentioning the problem.

Regards,
Phil
May 09 2004
parent Phil Thompson <phil electricvisions.com> writes:
One thing I forgot to mention is that this only occurs when selecting 
the -g compiler option



Phil Thompson wrote:

 I seem to have found a problem that I've narrowed down somewhat.
 
 #include <string>
 #include <fstream>
 #include <hash_map>
 
 int main(int argc, char *argv[])
 {
     std::ifstream inputStream;
     std::hash_map<std::string, std::string> hashMap;
 
     return 0;
 }
 
 Attempting to compile and link the preceeding code causes the error 
 mentioned in the subject.
 
 * If you remove the code the error does not occur
 * If you change hash_map to use map the error goes away
 * If you change either of the template arguments from std::string to int 
 the error goes away
 
 I could probably get away with using map instead of hash_map for the 
 time being but I thought it would be worth mentioning the problem.
 
 Regards,
 Phil
May 09 2004