Using DCMTK with Visual Studio 2005?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Clayton Vasconcelos
Posts: 3
Joined: Fri, 2007-07-13, 21:45

Using DCMTK with Visual Studio 2005?

#1 Post by Clayton Vasconcelos »

I am trying to use dcmtk with VC 2005 but I´m get some errors.

I built and I installed. When I put for exemple:

#include "dcmtk/config/osconfig.h"

e get the message bellow:

c:\dcmtk-3.5.4-win32-i386\include\dcmtk\config\cfwin32.h(94) : warning C4005: 'HAVE_CONST_CAST' : macro redefinition
c:\wxwidgets-2.8.4\include\wx\defs.h(299) : see previous definition of 'HAVE_CONST_CAST'

c:\dcmtk-3.5.4-win32-i386\include\dcmtk\config\cfwin32.h(131) : warning C4005: 'HAVE_DYNAMIC_CAST' : macro redefinition
c:\wxwidgets-2.8.4\include\wx\defs.h(308) : see previous definition of 'HAVE_DYNAMIC_CAST'
c:\dcmtk-3.5.4-win32-i386\include\dcmtk\config\cfwin32.h(362) : error C2371: 'ssize_t' : redefinition; different basic types
c:\wxwidgets-2.8.4\include\wx\defs.h(1015) : see declaration of 'ssize_t'

c:\dcmtk-3.5.4-win32-i386\include\dcmtk\config\cfwin32.h(507) : warning C4005: 'HAVE_REINTERPRET_CAST' : macro redefinition
c:\wxwidgets-2.8.4\include\wx\defs.h(302) : see previous definition of 'HAVE_REINTERPRET_CAST'

c:\dcmtk-3.5.4-win32-i386\include\dcmtk\config\cfwin32.h(546) : warning C4005: 'HAVE_STATIC_CAST' : macro redefinition
c:\wxwidgets-2.8.4\include\wx\defs.h(305) : see previous definition of 'HAVE_STATIC_CAST'
Build log was saved at "file://c:\Documents and Settings\clayton\Desktop\Exemplo\Debug\BuildLog.htm"

Exemplo - 1 error(s), 4 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Clayton DCM

Prash
Posts: 4
Joined: Thu, 2007-07-19, 18:16

Re: Using DCMTK with Visual Studio 2005?

#2 Post by Prash »

Hi,

I am in the process of a similar attempt, although I dont use wxwidgets, so I dont get duplicate definition errors.

I am able to successfully compile dcmdata and ofstd libs, and link them with a managed C++ forms application; and it runs in release build, but gives access violation in debug build.

I will post in detail soon.

Good luck,

Pixel.To.Life.
Last edited by Prash on Mon, 2011-02-14, 18:20, edited 3 times in total.

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

#3 Post by Marco Eichelberg »

This problem is likely to appear whenever you use two different libraries that make intensive use of Gnu autoconf macros for platform independence. In most instances, the warnings should be harmless and can be ignored. There is no way that I am aware of to get rid of them without manually changing the code generated by autoconf, which is usually a bad idea because changes would get lost every time the configure script is re-generated. The error is caused by the same problem (both header files try to define the same type because the OS does not define it). Here you have no alternative to changing both of the two files like this. Original code:

Code: Select all

#ifdef HAVE_NO_TYPEDEF_SSIZE_T
typedef long ssize_t;
#endif
Modified code:

Code: Select all

#ifdef HAVE_NO_TYPEDEF_SSIZE_T
#ifndef TYPEDEF_SSIZE_T_DEFINED
#define TYPEDEF_SSIZE_T_DEFINED
typedef long ssize_t;
#endif
#endif

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 0 guests