Error in compile with MSVC++, why? who can help me?

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
nanren0542
Posts: 2
Joined: Sat, 2006-05-27, 03:27

Error in compile with MSVC++, why? who can help me?

#1 Post by nanren0542 »

I copy dcmtk3.5.4 .h and .lib file to my MSVC++ project directory, and the compile, found more error. see following.

code:

BOOL CTestDlg::OnInitDialog()
{
.....

DcmFileFormat fileformat;
}


error:

--------------------Configuration: test - Win32 Debug--------------------
Linking...
libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
libcmtd.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCRTD.dll)
libcmtd.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int,bool)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I_N@Z) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: bool __thiscall std::locale::_Iscloc(void)const " (?_Iscloc@locale@std@@QBE_NXZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "public: virtual __thiscall std::ios_base::~ios_base(void)" (??1ios_base@std@@UAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "protected: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@IAEXXZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(ios.obj) : error LNK2005: "protected: void __thiscall std::ios_base::_Init(void)" (?_Init@ios_base@std@@IAEXXZ) already defined in msvcprtd.lib(MSVCP60D.dll)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in libcmtd.lib(mbctype.obj)
libcpmtd.lib(iostream.obj) : error LNK2005: "public: __thiscall std::ios_base::Init::Init(void)" (??0Init@ios_base@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(iostream.obj) : error LNK2005: "public: __thiscall std::ios_base::Init::~Init(void)" (??1Init@ios_base@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(locale.obj) : error LNK2005: "public: __thiscall std::_Locinfo::_Locinfo(char const *)" (??0_Locinfo@std@@QAE@PBD@Z) already defined in msvcprtd.lib(MSVCP60D.dll)
libcpmtd.lib(locale.obj) : error LNK2005: "public: __thiscall std::_Locinfo::~_Locinfo(void)" (??1_Locinfo@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
msvcrtd.lib(cinitexe.obj) : warning LNK4098: defaultlib "libcmtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
testDlg.obj : error LNK2001: unresolved external symbol "public: __thiscall DiRegister::DiRegister(void)" (??0DiRegister@@QAE@XZ)
testDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall DiRegister::~DiRegister(void)" (??1DiRegister@@UAE@XZ)
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/test.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

test.exe - 23 error(s), 2 warning(s)

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Read the FAQ.

nanren0542
Posts: 2
Joined: Sat, 2006-05-27, 03:27

Thank you very much!

#3 Post by nanren0542 »

Jörg Riesmeier wrote:Read the FAQ.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest