<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="top" style="font: inherit;"><p>Dear Insight-Users,<br></p>
<p>some time ago I tried to compile ITK with the Support for Python using Visual Studio 2010 with Win64. I wanted to support 2,3,4 and 5 dimensions and all available datatypes. I committed some patches to get rid of some errors I've found.</p>
<p>That time I ran into a lot of issues and discontinued.<br></p>
<p>Now I started again compiling and wanted to use VS2008 with only win32. Again I added 4 and 5 dimensions to the standard 2 and 3 and I switched on all the available datatypes for Python support.</p>
<p>This time I got the following compiler or linker error:<br></p>
<p>itkZeroFluxNeumannPadImageFilterPython.cpp</p>
<p>itkWrapPadImageFilterPython.cpp</p>
<p>itkWarpImageFilterPython.cpp</p>
<p>itkVectorResampleImageFilterPython.cpp</p>
<p>itkTileImageFilterPython.cpp</p>
<p>itkSliceBySliceImageFilterPython.cpp</p>
<p>itkShrinkImageFilterPython.cpp</p>
<p>itkResampleImageFilterPython.cpp</p>
<p>itkRegionOfInterestImageFilterPython.cpp</p>
<p>itkPermuteAxesImageFilterPython.cpp</p>
<p>itkPasteImageFilterPython.cpp</p>
<p>itkOrientImageFilterPython.cpp</p>
<p>itkMirrorPadImageFilterPython.cpp</p>
<p>itkInterpolateImageFilterPython.cpp</p>
<p>itkFlipImageFilterPython.cpp</p>
<p>itkExpandImageFilterPython.cpp</p>
<p>itkCyclicShiftImageFilterPython.cpp</p>
<p>itkCropImageFilterPython.cpp</p>
<p>itkBSplineUpsampleImageFilterPython.cpp</p>
<p>itkBSplineDownsampleImageFilterPython.cpp</p>
<p>Code wird generiert...</p>
<p>c:\itksrc\modules\core\common\include\itkimage.h(284) : fatal error C1128: Die Anzahl von Abschnitten hat das Formatierungslimit der Objektdatei &#252;berschritten: Kompilieren mit /bigobj.</p>
<p>&#160;Ergebnisse &#160; &#160; Das Buildprotokoll wurde unter "file://c:\itkbin\Wrapping\Modules\ITKImageGrid\ITKImageGridPython.dir\Release\BuildLog.htm" gespeichert.</p>
<p>ITKImageGridPython - 1 Fehler, 0 Warnung(en)<br></p>
<p>I did the compilation of this example by hand with /bigobj as extra flag and voila it worked.</p>
<p>Then I wanted to add the /bigobj flag to my CMake configuration so that it automatically is included and I can commit a patch for review.</p>
<p>In CMake/ITKSetStandardCompilerFlags.cmake I 've found a option that already made use of /bigobj whenever VS2005 is used or Win64 is enabled.</p>
<p>Since /bigobj is allowed after VS2005 I changed:<br></p>
<p>if(CMAKE_CL_64&#160;OR&#160;CMAKE_COMPILER_2005)</p>
<p>set(ITK_REQUIRED_CXX_FLAGS&#160;"${ITK_REQUIRED_CXX_FLAGS}&#160;/bigobj")</p>
<p>endif()<br></p>
<p>to:&#160;<br></p>
<p>&#160; &#160; &#160; &#160; &#160;if(MSVC_VERSION GREATER 1400 OR MSVC_VERSION EQUAL 1400)</p>
<p>&#160; &#160; &#160; &#160; &#160; &#160;set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} /bigobj")</p>
<p>&#160; &#160; &#160; &#160; &#160;endif()<br></p>
<p>which might not be 100 percent correct but at least it does what I want it to do what I've checked with:</p>
<p>&#9;</p>
<p>&#9;message("Flags are ${ITK_REQUIRED_CXX_FLAGS}")<br></p>
<p>which shows me:<br></p>
<p>&#9;Flags are /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR -W3 /bigobj<br></p>
<p>I assume the -W3 to be wrong and commented the generating line.</p>
<p>My problem is now that its not appearing in the final results of CMAKE_CXX_FLAGS although it is&#160;in the variable at the end of CMakeLists.txt in C:\itksrc which I checked with a message.<br>
What am I doing wrong?</p>
<p>Best regards,<br>
Willi</p>
</td></tr></table>