error hdf5

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@@YAXPBG00II@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@
@YAXPBG00II@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@@AAE@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@
@AAEAAV0@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,

···

<http://www.laveshgupta.com>

--
Lavesh Kumar Gupta
M.S. in Electrical and Computer Engineering
Rutgers University
New Jersey
www.laveshgupta.com

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 mike.jackson@bluequartz.net
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@@YAXPBG00II@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@@YAXPBG00II@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@@AAE@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@@AAEAAV0@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.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Some portion of your build has been linked to release libraries (LIBCMT)
but this configuration is a debug build so by default it wants to link
to the debug version of that library (LIBCMTD). You should be consistent
across all your projects to be all debug or all release, not mixed. You
will have difficulty debugging later when it cannot dive into the
routines done in release mode.

However, you can get away with it by going to
Project/Properties/Linker/Input and under Ignore Specific Libraries put
libcmt.

Jack

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:
1>Debug Win32 ------ 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
1>defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already
1>defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005:
1>__set_invalid_parameter_handler already defined in
1>LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005:
1>__get_invalid_parameter_handler already defined in
1>LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl
1>_invoke_watson(unsigned short const *,unsigned short const
1>*,unsigned short const *,unsigned int,unsigned int)"
1>(?_invoke_watson@@YAXPBG00II@Z) already defined in
1>LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already
1>defined in LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl
1>_invalid_parameter(unsigned short const *,unsigned short const
1>*,unsigned short const *,unsigned int,unsigned int)"
1>(?_invalid_parameter@@YAXPBG00II@Z) already defined in
1>LIBCMTD.lib(invarg.obj)
1>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler
1>already defined in LIBCMTD.lib(invarg.obj)
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
1>type_info::type_info(class type_info const &)"
1>(??0type_info@@AAE@ABV0@@Z) already defined in
1>LIBCMTD.lib(typinfo.obj)
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info &

1>__thiscall type_info::operator=(class type_info const &)"
1>(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
1>LIBCMTD.lib(typinfo.obj)
1>msvcrt.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in
1>LIBCMTD.lib(dbgmalloc.obj)
1>msvcrt.lib(MSVCR90.dll) : error LNK2005: _free already defined in
1>LIBCMTD.lib(dbgfree.obj) LINK : warning LNK4098: defaultlib 'LIBCMT'

1>conflicts with use of other libs; use /NODEFAULTLIB:library
1>LIBCMTD.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib'

1>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 Build log was saved at
"file://c:\Users\lavesh\Documents\Visual Studio
2008\Projects\hdf5_create1\hdf5_create1\Debug\BuildLog.htm"

···

-----Original Message-----
On Aug 12, 2010, at 3:21 AM, lavesh gupta wrote:

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.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org