-3

Anyone come across this error before? I'm at a loss to what precisely could be causing this:

1>...include\sstream(640): error : "std::basic_ios<_Elem, _Traits>::basic_ios(const std::basic_ios<_Elem, _Traits>::_Myt &) [with _Elem=char, _Traits=std::char_traits<char>]"
1>...include\istream(922): error : "std::basic_ios<_Elem, _Traits>::basic_ios(const std::basic_ios<_Elem, _Traits>::_Myt &) [with _Elem=char, _Traits=std::char_traits<char>]"
1>...include\istream(18): error : "std::basic_ios<_Elem, _Traits>::basic_ios(const std::basic_ios<_Elem, _Traits>::_Myt &) [with _Elem=char, _Traits=std::char_traits<char>]"
1>...include\ostream(37): error : "std::basic_ios<_Elem, _Traits>::basic_ios(const std::basic_ios<_Elem, _Traits>::_Myt &) [with _Elem=char, _Traits=std::char_traits<char>]"

It doesn't give any indication of anything in my source code that could have caused this, and I have no idea what problem this error is pointing to (it just says error). I mean, I use streams, strings all over my source code, so can anyone hint at what could be causing this?

MSVC 2010, compiled using NVCC

mchen
  • 9,808
  • 17
  • 72
  • 125
  • 2
    Can you show the code it's trying to compile when this comes up? Perhaps look a few lines above this, it may show a line from your code. – Collin May 13 '13 at 02:01
  • Thanks, but these lines are the only lines causing trouble now - there are no more lines above it. I can post my source online, but honestly it's many thousands of lines long across many several files. I was just wondering if anyone had come across this one before. – mchen May 13 '13 at 02:03
  • 1
    @MiloChen So your compiler just randomly decided to throw those errors at you? You must've written some code that generated those errors. Please post that code. – Praetorian May 13 '13 at 02:05
  • I've just finished restructuring very large sections of code, where almost all files were changed, so I really can't pin it down to a specific change I've done recently. I've managed to resolve all compiler errors down to these last 4. – mchen May 13 '13 at 02:06
  • @MiloChen Which file was the compiler building when these errors came up? – Collin May 13 '13 at 02:07
  • Thanks - my `main` file. Yes, that's one way to go - I'll slowly move functions out of that file until the error comes from a different file. – mchen May 13 '13 at 02:10
  • @MiloChen: Are these messages in the "Error" window or the "output" window? Because the "Error" window just has summaries, and the "output" window has all of the details. – Mooing Duck May 13 '13 at 17:53

1 Answers1

1

After hours of isolating the bug, I managed to resolve the issue: in case anyone comes across this error, the error is NVCC's way of complaining that you're implicitly copying a std::stringstream object, which is not allowed.

In my case, I had an exception class myError which contained a std::stringstream object deep down inside, and calling throw myError(...) implicitly caused an illegal copy to occur.

The full resolution is explained in this separate answer.

Community
  • 1
  • 1
mchen
  • 9,808
  • 17
  • 72
  • 125