Ali,<br><br>As Luis said, there is very little code in the shared libraries. Most of the code is templated and&nbsp; does not appear in those libraries.<br><br>Are you building with debug? Jim and I did a study a while back, comparing the sizes of executables with debug/optimization/static/shared combinations. I can&#39;t find my notes on this. I recall that with debug turned on, the executables were 3-10 times larger.
<br><br>Bill<br><br><div class="gmail_quote">On Nov 10, 2007 10:48 AM, Ali - &lt;<a href="mailto:saveez@hotmail.com">saveez@hotmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div><div style="text-align: left;">Luis,<br><br>I remember trying to compile the demons registration example under MinGW and static-linking it to ITK - I think the exe file was something about 4 MB or so. Regardless of everything else, just think of the process in this way: the linker has to &#39;generate&#39; a big binary file for static linking (a few MB) comparing to the shared linking version (of the order of 
0.1 MB). This binary &#39;generation&#39; is a slow one which you may not feel when compiling the shared-lib ITK once and linking against it many times. But it becomes a pain when you have to static-link your exe many times.
<br><br>I did not do any profiling on this, but try the demons registration example, qualitatively, it felt like the linking time linearly increased with the output binary size.<br><br></div><div><div></div><div class="Wj3C7c">
&gt; <br>&gt; <br>&gt; Hi Ali,<br>&gt; <br>&gt; &gt; <br>&gt; &gt; Even if there were no eroors, ITK under MinGW is not really useful<br>&gt; &gt; right now, ITK is a big template-basd library and static-linking it<br>&gt; &gt; to your binary will be a slow-long process.
<br>&gt; <br>&gt; <br>&gt; <br>&gt; I&#39;m not quite sure the statement above makes sense.<br>&gt; <br>&gt; <br>&gt; 1) Yes, ITK is an almost fully templated library<br>&gt; <br>&gt; 2) Whether you build it as shared or static library,
<br>&gt;     a very small fraction of the code goes into that library<br>&gt; <br>&gt; 3) Most of the code of ITK is actually compiled when you<br>&gt;     compile your application, not when you build ITK.<br>&gt; <br>&gt; 
<br>&gt; The difference between using static or shared when building<br>&gt; ITK libraries, make that the linking time of your application<br>&gt; will change by a small fraction. Linking is in itself a small<br>&gt; fraction of the build time compared to compilation itself.
<br>&gt; <br>&gt; <br>&gt; <br>&gt;     Regards,<br>&gt; <br>&gt; <br>&gt;        Luis<br>&gt; <br>&gt; <br>&gt; <br>&gt; --------------<br>&gt; Ali - wrote:<br>&gt; &gt; Thomas,<br>&gt; &gt; <br>&gt; &gt; ITK could be compiled on MinGW only as a static library -- when the 
<br>&gt; &gt; shared-lib flag was on there were linking errors. There were attempts to <br>&gt; &gt; solve these issue just before the 3.4 release, but it didn&#39;t get <br>&gt; &gt; anywhere. The errors that you reported could be some side effects of 
<br>&gt; &gt; those attempts.<br>&gt; &gt; <br>&gt; &gt; Even if there were no eroors, ITK under MinGW is not really useful right <br>&gt; &gt; now, ITK is a big template-basd library and static-linking it to your <br>&gt; &gt; binary will be a slow-long process.
<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; Hi ITK users<br>&gt; &gt; <br>&gt; &gt; Between ITK v 3.2.0 and v 3.4.0, the file<br>&gt; &gt; ITK/Utilities/itkjpeg/jconfig.h.in had been modified in the line 24.<br>&gt; &gt; In 
3.2.0 version the line was :<br>&gt; &gt;              #if defined (_WIN32) &amp;&amp; !(defined(__CYGWIN__) ||<br>&gt; &gt; defined(__MINGW32__))<br>&gt; &gt; In 3.4.0 version the line is :<br>&gt; &gt;              #if defined (_WIN32) &amp;&amp; !defined(__CYGWIN__)
<br>&gt; &gt; <br>&gt; &gt; On my MinGW platform, the ITK 3.2.0 compiling with success.<br>&gt; &gt; But the new version 3.4.0 generate this compiling error :<br>&gt; &gt; [  5%] Building C object<br>&gt; &gt; Utilities/itktiff/CMakeFiles/itktiff.dir/tif_jpeg.obj
<br>&gt; &gt; In file included from<br>&gt; &gt; G:/OTB-DART-NIGHTLY/sources/InsightToolkit-3.4.0/Utilities/itktiff/tif_jpeg.c:74: <br>&gt; &gt; <br>&gt; &gt; G:/OTB-DART-NIGHTLY/nightly/mingw/outils/binaries/static/debug/itk-
3.4.0-MinGW/Utilities/itkjpeg/8/jpeglib.h:99: <br>&gt; &gt; <br>&gt; &gt; parse error before &quot;boolean&quot;<br>&gt; &gt; G:/OTB-DART-NIGHTLY/nightly/mingw/outils/binaries/static/debug/itk-3.4.0-MinGW/Utilities/itkjpeg/8/jpeglib.h:115: 
<br>&gt; &gt; <br>&gt; &gt; parse error before &quot;boolean&quot;<br>&gt; &gt; G:/OTB-DART-NIGHTLY/nightly/mingw/outils/binaries/static/debug/itk-3.4.0-MinGW/Utilities/itkjpeg/8/jpeglib.h:167: <br>&gt; &gt; <br>&gt; &gt; parse error before &quot;boolean&quot;
<br>&gt; &gt; G:/OTB-DART-NIGHTLY/nightly/mingw/outils/binaries/static/debug/itk-3.4.0-MinGW/Utilities/itkjpeg/8/jpeglib.h:182: <br>&gt; &gt; <br>&gt; &gt; parse error before &#39;*&#39; token<br>&gt; &gt; :<br>&gt; &gt; :
<br>&gt; &gt; (with CMake v 2.4.6)<br>&gt; &gt; <br>&gt; &gt; Could you help me, How can I solve my problem ?<br>&gt; &gt; <br>&gt; &gt; Thanks,<br>&gt; &gt; Thomas<br>&gt; &gt; <br>&gt; &gt; ------------------------------------------------------------------------
<br>&gt; &gt; Are you the Quizmaster? Play BrainBattle with a friend now! <br>&gt; &gt; &lt;<a href="http://specials.uk.msn.com/brainbattle" target="_blank">http://specials.uk.msn.com/brainbattle</a>&gt;<br>&gt; &gt; <br>
&gt; &gt; <br>&gt; &gt; ------------------------------------------------------------------------<br>&gt; &gt; <br>&gt; &gt; _______________________________________________<br>&gt; &gt; Insight-users mailing list<br>&gt; &gt; 
<a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br>&gt; &gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a>
<br><br><hr></div></div>Get free emoticon packs and customisation from Windows Live.  <a href="http://www.pimpmylive.co.uk" target="_blank">Pimp My Live!</a></div>
<br>_______________________________________________<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">
http://www.itk.org/mailman/listinfo/insight-users</a><br><br></blockquote></div><br>