Build Errors for DicomImage Class Construction in VS8

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
veryhotsauasge
Posts: 7
Joined: Mon, 2006-01-30, 14:06

Build Errors for DicomImage Class Construction in VS8

#1 Post by veryhotsauasge »

Please Help!

I've written a really simple code contained in DicomReaderWrap.cpp
and DicomReaderWrap.h


-------------DicomReaderWrap.h-----------------------------------------------------------------
#pragma once
#include "dcmtk/dcmimgle/dcmimage.h"

class DicomReaderWrap
{
private:
DicomImage* myDicomImage;

public:
__declspec(dllexport) DicomReaderWrap(void);
__declspec(dllexport) ~DicomReaderWrap(void);
__declspec(dllexport) void LoadImage(const char *filename);


};

----------DicomReaderWrap.cpp-----------------------------------------------------------------
#include "StdAfx.h"
#include "DicomReaderWrap.h"
#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */



DicomReaderWrap::DicomReaderWrap(void)
{
}

DicomReaderWrap::~DicomReaderWrap(void)
{
}

void DicomReaderWrap::LoadImage(const char *filename)
{
DicomImage *image = new DicomImage(filename); <- this line screws up when linking
}

----------------------------------------------------------------------------------
with C++ Options:
/Od /I "..\..\config\include" /I "..\include" /I "..\..\ofstd\include" /I "..\..\dcmdata\include" /I "..\..\dcmimgle\include" /I "..\..\dcmimage\include" /I "C:\DEV\DiCom\zlib-1.2.3\include" /I "C:\DEV\DiCom\tiff-3.7.4\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_REENTRANT" /D "WITH_LIBXML" /D "WITH_LIBTIFF" /D "WITH_OPENSSL" /D "WITH_ZLIB" /D "_USRDLL" /D "DICOMIMAGEEX_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MDd /Gy /Yu"stdafx.h" /Fp"Debug\DicomImageEx.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Z7 /TP /errorReport:prompt

-----------------------------------------------------------------------------------
and Linker Options:
/OUT:"C:\DEV\DiCom\dcmtk-lite\DICOMImage\Debug\DicomImageEx.dll" /INCREMENTAL /NOLOGO /LIBPATH:"..\debug" /LIBPATH:"..\\" /LIBPATH:"..\..\ofstd\debug" /LIBPATH:"..\..\ofstd\\" /LIBPATH:"..\..\dcmdata\debug" /LIBPATH:"..\..\dcmdata\\" /LIBPATH:"..\..\dcmimgle\debug" /LIBPATH:"..\..\dcmimgle\\" /LIBPATH:"..\..\dcmimage\\" /LIBPATH:"..\..\dcmimage\debug" /LIBPATH:"C:\DEV\DiCom\zlib-1.2.3\lib\debug" /LIBPATH:"C:\DEV\DiCom\zlib-1.2.3\lib\\" /LIBPATH:"C:\DEV\DiCom\tiff-3.7.4\lib\debug" /LIBPATH:"C:\DEV\DiCom\tiff-3.7.4\lib\\" /LIBPATH:"..\..\ofstd\libsrc\debug" /LIBPATH:"..\..\ofstd\libsrc\\" /LIBPATH:"..\..\dcmdata\libsrc\debug" /LIBPATH:"..\..\dcmdata\libsrc\\" /LIBPATH:"..\..\dcmimgle\libsrc\debug" /LIBPATH:"..\..\dcmimgle\libsrc\\" /LIBPATH:"..\..\dcmimage\libsrc\debug" /LIBPATH:"..\..\dcmimage\libsrc\\" /LIBPATH:"..\libsrc\debug" /LIBPATH:"..\libsrc\\" /DLL /MANIFEST /MANIFESTFILE:"Debug\DicomImageEx.dll.intermediate.manifest" /DEBUG /PDB:"c:\DEV\DiCom\dcmtk-lite\DICOMImage\debug\DicomImageEx.pdb" /SUBSYSTEM:WINDOWS /STACK:10000000 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib netapi32.lib wsock32.lib ofstd.lib dcmdata.lib dcmimgle.lib dcmimage.lib zlib_d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
-----------------------------------------------------------------------------------

I'm given this error



ofstd.lib(ofstring.obj) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: int __thiscall std::ios_base::width(void)const " (?width@ios_base@std@@QBEHXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: int __thiscall std::ios_base::width(int)" (?width@ios_base@std@@QAEHH@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::get(char &)" (?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" (?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: static int __cdecl std::char_traits<char>::eof(void)" (?eof@?$char_traits@D@std@@SAHXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::putback(char)" (?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: bool __thiscall std::ios_base::fail(void)const " (?fail@ios_base@std@@QBE_NXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in msvcprtd.lib(MSVCP80D.dll)
ofstd.lib(ofstring.obj) : error LNK2005: "public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in ofstd.lib(ofstring.obj)
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in ofstd.lib(ofstring.obj)
libcpmtd.lib(cerr.obj) : error LNK2005: "public: static int __cdecl std::char_traits<char>::eof(void)" (?eof@?$char_traits@D@std@@SAHXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(cerr.obj) : error LNK2005: "public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" (?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(cerr.obj) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(cerr.obj) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(cout.obj) : error LNK2005: "public: static int __cdecl std::char_traits<char>::eof(void)" (?eof@?$char_traits@D@std@@SAHXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(cout.obj) : error LNK2005: "public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" (?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(cout.obj) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(cout.obj) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::facet_Register(class std::locale::facet *)" (?facet_Register@facet@locale@std@@CAXPAV123@@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(locale0.obj) : error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(xdebug.obj) : error LNK2005: "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(xdebug.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??_U@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z) already defined in msvcprtd.lib(MSVCP80D.dll)
libcpmtd.lib(xdebug.obj) : error LNK2005: "struct std::_DebugHeapTag_t const & __cdecl std::_DebugHeapTag_func(void)" (?_DebugHeapTag_func@std@@YAABU_DebugHeapTag_t@1@XZ) already defined in msvcprtd.lib(MSVCP80D.dll)
Creating library C:\DEV\DiCom\dcmtk-lite\DICOMImage\Debug\DicomImageEx.lib and object C:\DEV\DiCom\dcmtk-lite\DICOMImage\Debug\DicomImageEx.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' 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
C:\DEV\DiCom\dcmtk-lite\DICOMImage\Debug\DicomImageEx.dll : fatal error LNK1169: one or more multiply defined symbols found
Build log was saved at "file://c:\DEV\DiCom\dcmtk-lite\DICOMImage\DicomImageEx\Debug\BuildLog.htm"
DicomImageEx - 41 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 5 up-to-date, 0 skipped ==========

I don't even know where any of the errors are comming from. I've even tried to create a project within the dcmimage official build but i'm still getting msvcprtd.lib(MSVCP80D.dll) errors

Could anyone help with this problem?

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

#2 Post by Marco Eichelberg »

See FAQ #26.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest