• Forum
  • Lounge
  • What is the worst compile error you've e

 
What is the worst compile error you've ever gotten?

However you want to define "worst" -- be it "longest", "most unintelligible",
"most unhelpful" whatever.

For me, this little test program here:

1
2
3
4
5
6
7
8
9
10
11
#include <boost/mpl/set.hpp>
#include <boost/variant/variant.hpp>
#include <string>

int main() {
    typedef boost::mpl::set< int, std::string >    MySet;
    typedef boost::make_variant_over<MySet>::type  MyVariantSet;

    MyVariantSet s;
    s = 3;
}


consisting of exactly 255 characters, generates a whopping 46K
(as reported by wc -c) of compile errors (64 lines of output, 3805 words,
46468 characters), all because apparently I cannot make a boost::variant
out of a boost::mpl::set (but I can out of a boost::mpl::vector).

(The only text in the output that even refers to my code is a couple
of instances of "t.cpp:9: instantiated from here").

EDIT: Incidentally, change the boost::mpl::set to boost::mpl::vector,
and include vector.hpp instead of set.hpp and it compiles without error.
Last edited on
I love the length of the Visual Studio Errors for the STL... it´s always a joy to have 3-5 lines of code on an 1920width screen... because you forgot to include or define something...
 "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


Because I felt like such an idiot after reading it.

-Albatross

EDIT: Okay, it's a linker error. That's fine too, no?
Last edited on
I wanted an std::vector of ofstream objects and another one of ostream object within a class. The class would check each object in both vectors to see if it was open, and if it was, would send output to it. Anyway for some reason, whenver I tried any std::vector functions on the ostream vector (but not the ofstream vector) gcc would pump out about twenty lines of illegible errors.
@chrisname: That probably comes from the fact, that std::ostream and std::ofstream are not copyable (private copy ctor and assignment operator), but the stl containers heavily rely on copying. That you get the errors only if you use a function probably comes from the fact that std::vector is a template, and the code for these functions is not instantiated before its first use.
Thanks. I managed to solve it by casting the ofstreams to ostreams and it worked. I don't have the code anymore, though.
Topic archived. No new replies allowed.