[vtkusers] Building VTK against static Tcl/Tk libraries

David Cole david.cole at kitware.com
Fri Jul 11 10:09:28 EDT 2008


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...
Tcl is built against the static MSVC runtime libs, you need to build
everything else against those same libs too.

Changing those flags at CMake configure time means you should do a complete
rebuild of VTK also. (Be sure to


HTH,
David


On Fri, Jul 11, 2008 at 9:49 AM, Ritesh Bafna <riteshbafna at gmail.com> wrote:

> Hi,
>
> I am trying to build VTK against static Tcl/Tk libraries with Visual Studio
> 8 (2005)
>
> I built Tcl/tk using the following commands:
> nmake -f makefile.vc INSTALLDIR=c:\Tcl OPTS=static install
> nmake -f makefile.vc INSTALLDIR=c:\Tcl TCLDIR=c:\Tcl-Source OPTS=static
> install
>
> These commands created tcl85s.lib, tk85s.lib, and tclsh85s.exe.
>
> 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
>
> When I try building VTK I get the following Linker errors and warnings(35
> of them).
>
> 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
> LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in
> MSVCRTD.lib(MSVCR80D.dll)
> MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __strdup already defined in
> LIBCMT.lib(strdup.obj)
> LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other
> libs; use /NODEFAULTLIB:library
>
> Can anyone suggest a solution to this?
>
> Thanks,
> Ritesh
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080711/aba99ad8/attachment.htm>


More information about the vtkusers mailing list