Help! DCMTK error LNK

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Marìa Dolore
Posts: 10
Joined: Mon, 2006-06-12, 23:16

Help! DCMTK error LNK

#1 Post by Marìa Dolore »

Hi!
I want to use DCMTK, but, I have a problem.

Can you help me?
Thanks.

When I try to including the lybraries

#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmdata/dctk.h"

I got the next errors:

Linking...
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits
<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) already defined in dcmdata.lib(dcfilefo.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??6std@@YAAAV?$basic_ostream@DU?$cha
r_traits@D@std@@@0@AAV10@PBD@Z) already defined in dcmdata.lib(dcfilefo.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@
@1@AAV21@@Z) already defined in dcmdata.lib(dcfilefo.obj)
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)
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)
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in MSVCRTD.lib(MSVCRTD.dll)
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(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj)
LIBCMTD.lib(lconv.obj) : error LNK2005: _localeconv 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)
LIBCMTD.lib(getenv.obj) : error LNK2005: _getenv already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMTD.lib(strchr.obj) : error LNK2005: _strchr already defined in MSVCRTD.lib(MSVCRTD.dll)
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)
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCMTD" conflicts with use of other libs; use /NODEFAULTLIB:library
dcmdata.lib(dcistrmz.obj) : error LNK2001: unresolved external symbol _inflateInit2_
dcmdata.lib(dcistrmz.obj) : error LNK2001: unresolved external symbol _inflateInit_
dcmdata.lib(dcistrmz.obj) : error LNK2001: unresolved external symbol _inflateEnd
dcmdata.lib(dcistrmz.obj) : error LNK2001: unresolved external symbol _inflate
dcmdata.lib(dcostrmz.obj) : error LNK2001: unresolved external symbol _deflateInit2_
dcmdata.lib(dcostrmz.obj) : error LNK2001: unresolved external symbol _deflateEnd
dcmdata.lib(dcostrmz.obj) : error LNK2001: unresolved external symbol _deflate
Debug/testapp.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

ALL_BUILD - 36 error(s), 2 warning(s)

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1459
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

I wish people would read the FAQ before posting questions (see the annoucement posting at the top of the forum). Your specific question is addressed in FAQ #26 and FAQ #27.

Marìa Dolore
Posts: 10
Joined: Mon, 2006-06-12, 23:16

I can't linker dcmtk

#3 Post by Marìa Dolore »

Hi!
I install successfully DCMTK, and I run a test (FAQ #40: How do I use the DCMTK libraries in my application? [MSVC]) in in visual c++ 6.0, but I need made a test use MFC project, so

anybody can I help me how adde the libraries? :oops:

I added the libraries. I selected in the menu of visual: Tools->Options, so I selected the option Ligrary files, and put the path of libraries. But I can't work.


I red FAC, but I can't resolve the problem, and


these is the headeres:

#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmdata/dctk.h"

these is a part of code:

void CDcmDlg::OnButton1()
{//Boton abrir dcm


// Visualizar carpetas y archivos "Abrir"
CFileDialog Archivo_dcm( true, "dcm", "*.dcm" );
if (Archivo_dcm.DoModal() != IDOK) return;

//guardando el nombre del archivo

m_StrArchivo = Archivo_dcm.GetFileName();

//trabajando con DCMTK

DcmFileFormat fileformat;
OFCondition status = fileformat.loadFile( m_StrArchivo );

these is the error
}
-------------------Configuration: dcm - Win32 Debug--------------------
Linking...
dcmDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall DcmFileFormat::~DcmFileFormat(void)" (??1DcmFileFormat@@UAE@XZ)
dcmDlg.obj : error LNK2001: unresolved external symbol "public: __thiscall DcmFileFormat::DcmFileFormat(void)" (??0DcmFileFormat@@QAE@XZ)
Debug/dcm.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

dcm.exe - 3 error(s), 0 warning(s)

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest