You probably also need to replace "/MD" with "/MT" wherever they occur in CMAKE_CXX_FLAGS_DEBUG, CMAKE_CXX_FLAGS_RELEASE, CMAKE_CXX_FLAGS_MINSIZEREL and CMAKE_CXX_FLAGS_RELWITHDEBINFO and also in the corresponding *_C_FLAGS_* variables...<div>
<br></div><div>Tcl is built against the static MSVC runtime libs, you need to build everything else against those same libs too.</div><div><br></div><div>Changing those flags at CMake configure time means you should do a complete rebuild of VTK also. (Be sure to </div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br><div><br><div class="gmail_quote">On Fri, Jul 11, 2008 at 9:49 AM, Ritesh Bafna <<a href="mailto:riteshbafna@gmail.com">riteshbafna@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br><br>I am trying to build VTK against static Tcl/Tk libraries with Visual Studio 8 (2005)<br><br>I built Tcl/tk using the following commands:<br>
nmake -f <a href="http://makefile.vc" target="_blank">makefile.vc</a> INSTALLDIR=c:\Tcl OPTS=static install<br>
nmake -f <a href="http://makefile.vc" target="_blank">makefile.vc</a> INSTALLDIR=c:\Tcl TCLDIR=c:\Tcl-Source OPTS=static install<br><br>These commands created tcl85s.lib, tk85s.lib, and tclsh85s.exe.<br><br>For VTK I am pointing to the above Tcl/tk related libs and have turned ON VTK_TCL_TK_STATIC, and turned OFF BUILD_SHARED_LIBS<br>
<br>When I try building VTK I get the following Linker errors and warnings(35 of them).<br><br>tk85s.lib(tkMain.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance<br>
LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR80D.dll)<br>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __strdup already defined in LIBCMT.lib(strdup.obj)<br>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library<br>
<br>Can anyone suggest a solution to this?<br><br>Thanks,<br><font color="#888888">Ritesh<br>
</font><br>_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></div>