May 09, 2004 Unexpected OPTLINK Termination when using hash_map and ifstream | ||||
---|---|---|---|---|
| ||||
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 Re: Unexpected OPTLINK Termination when using hash_map and ifstream | ||||
---|---|---|---|---|
| ||||
Posted in reply to Phil Thompson | 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
|
Copyright © 1999-2021 by the D Language Foundation