1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>fatal error C1204:Compiler limit:internal structure overflow</title> 5<link rel="stylesheet" href="../boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../index.html" title="Boost.Python"> 8<link rel="up" href="../faq.html" title="Chapter 5. Frequently Asked Questions (FAQs)"> 9<link rel="prev" href="how_can_i_wrap_functions_which_t.html" title="How can I wrap functions which take C++ containers as arguments?"> 10<link rel="next" href="how_do_i_debug_my_python_extensi.html" title="How do I debug my Python extensions?"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="../images/boost.png"></td></tr></table> 14<hr> 15<div class="spirit-nav"> 16<a accesskey="p" href="how_can_i_wrap_functions_which_t.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="how_do_i_debug_my_python_extensi.html"><img src="../images/next.png" alt="Next"></a> 17</div> 18<div class="section"> 19<div class="titlepage"><div><div><h3 class="title"> 20<a name="faq.fatal_error_c1204_compiler_limit"></a><a class="link" href="fatal_error_c1204_compiler_limit.html" title="fatal error C1204:Compiler limit:internal structure overflow">fatal error C1204:Compiler 21 limit:internal structure overflow</a> 22</h3></div></div></div> 23<p> 24 <span class="bold"><strong>Q:</strong></span> <span class="emphasis"><em>I get this error message when 25 compiling a large source file. What can I do?</em></span> 26 </p> 27<p> 28 <span class="bold"><strong>A:</strong></span> You have two choices: 29 </p> 30<div class="orderedlist"><ol class="orderedlist" type="1"> 31<li class="listitem"> 32 Upgrade your compiler (preferred) 33 </li> 34<li class="listitem"> 35<p class="simpara"> 36 Break your source file up into multiple translation units. 37 </p> 38<p class="simpara"> 39 <code class="computeroutput"><span class="identifier">my_module</span><span class="special">.</span><span class="identifier">cpp</span></code>: 40 </p> 41<pre class="programlisting"><span class="special">...</span> 42<span class="keyword">void</span> <span class="identifier">more_of_my_module</span><span class="special">();</span> 43<span class="identifier">BOOST_PYTHON_MODULE</span><span class="special">(</span><span class="identifier">my_module</span><span class="special">)</span> 44<span class="special">{</span> 45 <span class="identifier">def</span><span class="special">(</span><span class="string">"foo"</span><span class="special">,</span> <span class="identifier">foo</span><span class="special">);</span> 46 <span class="identifier">def</span><span class="special">(</span><span class="string">"bar"</span><span class="special">,</span> <span class="identifier">bar</span><span class="special">);</span> 47 <span class="special">...</span> 48 <span class="identifier">more_of_my_module</span><span class="special">();</span> 49<span class="special">}</span> 50</pre> 51<p class="simpara"> 52 <code class="computeroutput"><span class="identifier">more_of_my_module</span><span class="special">.</span><span class="identifier">cpp</span></code>: 53 </p> 54<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">more_of_my_module</span><span class="special">()</span> 55<span class="special">{</span> 56 <span class="identifier">def</span><span class="special">(</span><span class="string">"baz"</span><span class="special">,</span> <span class="identifier">baz</span><span class="special">);</span> 57 <span class="special">...</span> 58<span class="special">}</span> 59</pre> 60<p class="simpara"> 61 If you find that a <code class="computeroutput"><span class="identifier">class_</span><span class="special"><...></span></code> declaration can't fit in a 62 single source file without triggering the error, you can always pass 63 a reference to the <code class="computeroutput"><span class="identifier">class_</span></code> 64 object to a function in another source file, and call some of its member 65 functions (e.g. <code class="computeroutput"><span class="special">.</span><span class="identifier">def</span><span class="special">(...)</span></code>) in the auxilliary source file: 66 </p> 67<p class="simpara"> 68 <code class="computeroutput"><span class="identifier">more_of_my_class</span><span class="special">.</span><span class="identifier">cpp</span></code>: 69 </p> 70<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">more_of_my_class</span><span class="special">(</span><span class="keyword">class</span><span class="special">&</span><span class="identifier">lt</span><span class="special">;</span><span class="identifier">my_class</span><span class="special">&</span><span class="identifier">gt</span><span class="special">;&</span><span class="identifier">amp</span><span class="special">;</span> <span class="identifier">x</span><span class="special">)</span> 71<span class="special">{</span> 72 <span class="identifier">x</span> 73 <span class="special">.</span><span class="identifier">def</span><span class="special">(</span><span class="string">"baz"</span><span class="special">,</span> <span class="identifier">baz</span><span class="special">)</span> 74 <span class="special">.</span><span class="identifier">add_property</span><span class="special">(</span><span class="string">"xx"</span><span class="special">,</span> <span class="special">&</span><span class="identifier">my_class</span><span class="special">::</span><span class="identifier">get_xx</span><span class="special">,</span> <span class="special">&</span><span class="identifier">my_class</span><span class="special">::</span><span class="identifier">set_xx</span><span class="special">)</span> 75 <span class="special">;</span> 76 <span class="special">...</span> 77<span class="special">}</span> 78</pre> 79</li> 80</ol></div> 81</div> 82<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 83<td align="left"></td> 84<td align="right"><div class="copyright-footer">Copyright © 2002-2015 David 85 Abrahams, Stefan Seefeld<p> 86 Distributed under the Boost Software License, Version 1.0. (See accompanying 87 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 88 </p> 89</div></td> 90</tr></table> 91<hr> 92<div class="spirit-nav"> 93<a accesskey="p" href="how_can_i_wrap_functions_which_t.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="how_do_i_debug_my_python_extensi.html"><img src="../images/next.png" alt="Next"></a> 94</div> 95</body> 96</html> 97