[vtkusers] Fwd: error while building vtk

Dave Partyka dave.partyka at kitware.com
Mon Oct 18 13:39:09 EDT 2010


You're mixing libraries that are compiled with /MT (static linking of the
runtime) and /MD (dynamic linking of the runtime). You can do one of two
things.

1. Make everything build one way or the other. (CMake defaults to /MD, so
most likely your VTK was built this way).
2. Add /NODEFAULTLIB:libcmt to CMAKE_SHARED_LINKER_FLAGS and
CMAKE_EXE_LINKER_FLAGS when running CMake.



On Mon, Oct 18, 2010 at 1:16 PM, Evan Schwab <Evan_Schwab at hms.harvard.edu>wrote:

> Hi,
>
> I am running Windows XP and trying to build vtk from the release and I get
> the error copied below.  Please let me know what needs to be done to solve
> this.
>
> Thanks
>
> Evan
>
>
> 1>------ Build started: Project: vtkIO, Configuration: Release x64 ------
> 1>Linking...
> 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _amsg_exit already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _initterm_e already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: exit already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(crtheap.obj) : error LNK2005: _malloc_crt already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(invarg.obj) : error LNK2005: _set_invalid_parameter_handler
> already defined in MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(invarg.obj) : error LNK2005: _invalid_parameter_noinfo already
> defined in MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(osfinfo.obj) : error LNK2005: _open_osfhandle already defined
> in MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(_file.obj) : error LNK2005: __iob_func already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_a already defined in
> MSVCRT.lib(cinitexe.obj)
> 1>LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_z already defined in
> MSVCRT.lib(cinitexe.obj)
> 1>LIBCMT.lib(crt0init.obj) : error LNK2005: __xc_a already defined in
> MSVCRT.lib(cinitexe.obj)
> 1>LIBCMT.lib(crt0init.obj) : error LNK2005: __xc_z already defined in
> MSVCRT.lib(cinitexe.obj)
> 1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)"
> (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __CppXcptFilter already defined
> in MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(winsig.obj) : error LNK2005: signal already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(tidtable.obj) : error LNK2005: _encode_pointer already defined
> in MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(tidtable.obj) : error LNK2005: _encoded_null already defined
> in MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(tidtable.obj) : error LNK2005: _decode_pointer already defined
> in MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(mlock.obj) : error LNK2005: _unlock already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(mlock.obj) : error LNK2005: _lock already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(fflush.obj) : error LNK2005: fflush already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(dosmap.obj) : error LNK2005: _errno already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(dosmap.obj) : error LNK2005: __doserrno already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(dosmap.obj) : error LNK2005: _dosmaperr already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(strftime.obj) : error LNK2005: strftime already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(tzset.obj) : error LNK2005: _tzset already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(stricmp.obj) : error LNK2005: _stricmp already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(atox.obj) : error LNK2005: atoi already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(tolower.obj) : error LNK2005: tolower already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(getenv.obj) : error LNK2005: getenv already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(strtol.obj) : error LNK2005: strtol already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>LIBCMT.lib(strtol.obj) : error LNK2005: strtoul already defined in
> MSVCRT.lib(MSVCR90.dll)
> 1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _strdup already defined in
> LIBCMT.lib(strdup.obj)
> 1>   Creating library C:\DEVEL\SHARED\vtk\bin\Release\vtkIO.lib and object
> C:\DEVEL\SHARED\vtk\bin\Release\vtkIO.exp
> 1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
> libs; use /NODEFAULTLIB:library
> 1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
> libs; use /NODEFAULTLIB:library
> 1>LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main
> referenced in function __tmainCRTStartup
> 1>C:\DEVEL\SHARED\vtk\bin\Release\vtkIO.dll : fatal error LNK1120: 1
> unresolved externals
> 1>Build log was saved at
> "file://c:\DEVEL\SHARED\vtk\IO\vtkIO.dir\Release\BuildLog.htm"
>
> --
> Evan Schwab
> Research Associate
> Megason Lab
> Department of Systems Biology
> Harvard Medical School
> 200 Longwood Ave
> Boston, MA 02115
> 908-938-3779
>
>
>
>
> --
> Evan Schwab
> Research Associate
> Megason Lab
> Department of Systems Biology
> Harvard Medical School
> 200 Longwood Ave
> Boston, MA 02115
> 908-938-3779
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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/20101018/42e3b646/attachment.htm>


More information about the vtkusers mailing list