You are linking a debug build and a release build so BOTH of the Microsoft C Runtime "LIBCMT" and "LIBCMTD" are being linked. This is bad. You will need to build both a debug and a release build of hdf5 into 2 separate directories and then setup your project to link against the correct library depending on the type of build you are performing. ___________________________________________________________ Mike Jackson www.bluequartz.net Principal Software Engineer [email protected] BlueQuartz Software Dayton, Ohio
On Aug 12, 2010, at 3:21 AM, lavesh gupta wrote: > > I am Lavesh Gupta, graduate student at Rutgers University. I build hdf5 for > my system using the configuration Windows 7, Visual studio 2008, and I am > using HDF5 1.8.5, zlib 1.2.5 and szip 2.1. > > The build(release) was successful and when I ran "hdf5check.bat" it didn't > give me any error. But when I tried running the attached code it gave me the > following linker error. > > I played around "Projects->options->c/C++->Code generation->Runtime Library" > and changed the settings from "Multi-threaded Debug DLL" to "Multi-threaded" > but still the error remained. > > Please provide me with any assistance. I will be grateful for the assistance. > > 1>------ Rebuild All started: Project: hdf5_create1, Configuration: Debug > Win32 ------ > 1>Deleting intermediate and output files for project 'hdf5_create1', > configuration 'Debug|Win32' > 1>Compiling... > 1>hdf5_create.cpp > 1>Compiling manifest to resources... > 1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 > 1>Copyright (C) Microsoft Corporation. All rights reserved. > 1>Linking... > 1>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined > in LIBCMTD.lib(invarg.obj) > 1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in > LIBCMTD.lib(invarg.obj) > 1>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler > already defined in LIBCMTD.lib(invarg.obj) > 1>LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler > already defined in LIBCMTD.lib(invarg.obj) > 1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl > _invoke_watson(unsigned short const *,unsigned short const *,unsigned short > const *,unsigned int,unsigned int)" (?_invoke_watson@@yaxpbg0...@z) already > defined in LIBCMTD.lib(invarg.obj) > 1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined > in LIBCMTD.lib(invarg.obj) > 1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl > _invalid_parameter(unsigned short const *,unsigned short const *,unsigned > short const *,unsigned int,unsigned int)" (?_invalid_parameter@@yaxpbg0...@z) > already defined in LIBCMTD.lib(invarg.obj) > 1>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already > defined in LIBCMTD.lib(invarg.obj) > 1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall > type_info::type_info(class type_info const &)" (??0type_info@@a...@abv0@@Z) > already defined in LIBCMTD.lib(typinfo.obj) > 1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info & > __thiscall type_info::operator=(class type_info const &)" > (??4type_info@@aaea...@abv0@@Z) already defined in LIBCMTD.lib(typinfo.obj) > 1>msvcrt.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in > LIBCMTD.lib(dbgmalloc.obj) > 1>msvcrt.lib(MSVCR90.dll) : error LNK2005: _free already defined in > LIBCMTD.lib(dbgfree.obj) > 1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other > libs; use /NODEFAULTLIB:library > 1>LIBCMTD.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib' > conflicts with use of other libs; use /NODEFAULTLIB:library > 1>C:\Users\lavesh\Documents\Visual Studio > 2008\Projects\hdf5_create1\Debug\hdf5_create1.exe : fatal error LNK1169: one > or more multiply defined symbols found > 1>Build log was saved at "file://c:\Users\lavesh\Documents\Visual Studio > 2008\Projects\hdf5_create1\hdf5_create1\Debug\BuildLog.htm" > 1>hdf5_create1 - 13 error(s), 2 warning(s) > ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== > Thanks > > Regards, > > > > > -- > Lavesh Kumar Gupta > M.S. in Electrical and Computer Engineering > Rutgers University > New Jersey > www.laveshgupta.com > > _______________________________________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
