From a21727741f1487b020c483ea6c690cef6ae480a4 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 14 Nov 2002 12:16:40 +0000 Subject: [PATCH] c1204 workaround documented [SVN r16235] --- doc/v2/faq.html | 69 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/doc/v2/faq.html b/doc/v2/faq.html index 398c8ea0..e78ce612 100644 --- a/doc/v2/faq.html +++ b/doc/v2/faq.html @@ -34,8 +34,12 @@
How can I wrap containers which take C++ containers as arguments?
+ +
fatal error C1204:Compiler limit:internal + structure overflow
+

Is return_internal reference efficient?

@@ -150,12 +154,73 @@ void foo(std::vector<double>& array) cvs -d:pserver:anonymous@cvs.cctbx.sourceforge.net:/cvsroot/cctbx login cvs -d:pserver:anonymous@cvs.cctbx.sourceforge.net:/cvsroot/cctbx co scitbx + + +

fatal error C1204:Compiler limit:internal + structure overflow

+ +
+ Q: I get this error message when compiling a large source + file. What can I do? + +

A: You have two choices:

+ +
    +
  1. Upgrade your compiler (preferred)
  2. + +
  3. + Break your source file up into multiple translation units. + +

    my_module.cpp:

    +
    +...
    +void more_of_my_module();
    +BOOST_PYTHON_MODULE(my_module)
    +{
    +   def("foo", foo);
    +   def("bar", bar);
    +   ...
    +   more_of_my_module();
    +}
    +
    + more_of_my_module.cpp: +
    +void more_of_my_module()
    +{
    +   def("baz", baz);
    +   ...
    +}
    +
    + If you find that a class_<...> declaration + can't fit in a single source file without triggering the error, you + can always pass a reference to the class_ object to a + function in another source file, and call some of its member + functions (e.g. .def(...)) in the auxilliary source + file: + +

    more_of_my_class.cpp: +

    +void more_of_my_class(class<my_class>& x)
    +{
    +   x
    +     .def("baz", baz)
    +     .add_property("xx", &my_class::get_xx, &my_class::set_xx)
    +     ;
    +
    +   ...
    +}
    +
    +
  4. +
+
+

Revised - 13 November, 2002 - + 13 November, 2002 +

© Copyright