<div dir="ltr">Hi Erik,<div><br></div><div>You're right - CMake could be improved to make handling the C runtime libs a little easier. They need to be edited manually in multiple places in the CMake gui usually.</div><div>
<br></div><div>Your case wouldn't hold for all people though - you can build static VTK libs against shared C runtimes if you need to.</div><div><br></div><div>I'd like to see a "Use Static C Runtime Libraries" option in CMake that adds /MT(d) to the linker options instead of /MD(d) by default.</div>
<div><br></div><div>Thanks,</div><div><br></div><div>Goodwin</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 25, 2014 at 4:39 PM, Kischell, Eric R. <span dir="ltr"><<a href="mailto:Kischell.Eric@mayo.edu" target="_blank">Kischell.Eric@mayo.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#4f6228">Maarten,<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#4f6228">Here is my note from a long time ago…<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#4f6228">
</span></b><b><span style="font-family:"Helvetica","sans-serif";color:#4f6228">vtkParallelCore-6.1 should be manually built the same way as all of the other libs in the calling chain.</span></b><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#4f6228"><u></u><u></u></span></b></p>
<p style="text-indent:.5in"><b><span style="font-family:"Century Schoolbook","serif";color:green">></span></b><span style="font-family:"Helvetica","sans-serif";color:black"> You said-- BUILD_SHARED_LIBS is checked</span><b><span style="font-family:"Century Schoolbook","serif";color:green"><u></u><u></u></span></b></p>
<p><b><span style="font-family:"Century Schoolbook","serif";color:green">Hello VTK Lurkers,</span></b>
<u></u><u></u></p>
<p><b><span style="font-family:"Century Schoolbook","serif";color:green">When building VTK 5.8 as a static library under WIN7 using C-Make 2.8.6…</span></b>
<br>
<b><span style="font-family:"Century Schoolbook","serif";color:green">I </span></b><b><span style="font-family:"Century Schoolbook","serif";color:red">un-check
</span></b><b><span style="font-family:"Century Schoolbook","serif";color:green">BUILD_SHARED_LIBS under the C-Make GUI.</span></b>
<br>
<b><span style="font-family:"Century Schoolbook","serif";color:green">The generated VC++ 2005 solution contains projects with
</span></b><br>
<b><span style="font-family:"Century Schoolbook","serif";color:green">C / C++ | Code Generation set to
</span></b><br>
<b><span style="font-family:"Century Schoolbook","serif";color:green">/MD instead of the correct /MT (Multi-threaded (/MT)).</span></b>
<br>
<b><span style="font-family:"Century Schoolbook","serif";color:green">I must then manually change all of the /MD's to /MT's under the C-Make GUI's advanced settings.</span></b>
<u></u><u></u></p>
<p><b><span style="font-family:"Century Schoolbook","serif";color:green">It would be more convenient to have C-Make automatically set to /MT and /MTd</span></b>
<br>
<b><span style="font-family:"Century Schoolbook","serif";color:green">if BUILD_SHARED_LIBS is
</span></b><b><span style="font-family:"Century Schoolbook","serif";color:red">un-checked</span></b><b><span style="font-family:"Century Schoolbook","serif";color:green">.</span></b>
<u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-family:"Century Schoolbook","serif";color:green">thx</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> vtkusers [mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>]
<b>On Behalf Of </b>Maarten Beek via vtkusers<br>
<b>Sent:</b> Wednesday, June 25, 2014 10:16 AM<br>
<b>To:</b> Goodwin Lawlor<br>
<b>Cc:</b> VTK Users<br>
<b>Subject:</b> Re: [vtkusers] /MD(d) vs /MT(d)<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black">Thanks for the reply.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">That's what I am trying to achieve.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">I am building an app that is linking to statically built libs, so I want to build my VTK statically as well.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">But the build breaks at the vtkParallelCore-6.1 project.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">A debug assertion fails when vtkHashSource-6.1.exe is run:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">dbgheap.c line 1322<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">Expression: _CrtIsValidHeapPointer(pUserData)<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">Maarten<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">On Tuesday, June 24, 2014 6:15:20 PM, Goodwin Lawlor <<a href="mailto:goodwin.lawlor.lists@gmail.com" target="_blank">goodwin.lawlor.lists@gmail.com</a>>
wrote:</span><span style="font-family:"Helvetica","sans-serif";color:black"><u></u><u></u></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black">Hi Maarten,<u></u><u></u></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black">I usually find when you link VTK libs against the static runtime all dependent libraries must be linked against it too... otherwise you get name collisions
between libcmt.lib (static) and </span><span style="font-size:10.0pt;font-family:"Segoe UI","sans-serif";color:#2a2a2a">msvcrt.lib (shared).</span><span style="font-family:"Helvetica","sans-serif";color:black"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Segoe UI","sans-serif";color:#2a2a2a">So, for example, if you generate the VTK Tcl wrapper libs, you have to build the static Tcl libs against libcmt.lib yourself for inclusion
in the project.</span><span style="font-family:"Helvetica","sans-serif";color:black"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black">hth,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black">Goodwin<u></u><u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black">On Mon, Jun 23, 2014 at 8:08 PM, Maarten Beek via vtkusers <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>> wrote:<u></u><u></u></span></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black">Hello,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">I can build VTK 6.1.0 perfectly fine with the default /MD(d) settings.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black">When I change /MD(d) into /MT(d) in CMake, the build breaks at the vtkParallelCore-6.1 project.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">BUILD_SHARED_LIBS is checked, as is VTK_Group_Qt.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">Anyone able to tell me how to build VTK with the /MT(d) setting?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">Thanks - Maarten<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><u></u><u></u></span></p>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica","sans-serif";color:black"><u></u> <u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>