Compilation error !!!

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
christian desir
Posts: 12
Joined: Mon, 2010-01-11, 15:21

Compilation error !!!

#1 Post by christian desir »

I get the last release of DCMTK : 3.6.0 (2011-01-06)
I used CMake 2.8.0, and I select DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS
DCMTK_WITH_DOXYGEN, DCMTK_WITH_THREADS.
I used Visual C++ 6.0.
I try to compile DCMTK and I have the following error :

Code: Select all

dcmtk-3.6.0\oflog\libsrc\winsock.cc(57) : error C2664: 'InterlockedCompareExchange' : cannot convert parameter 1 from 'void ** ' to 'volatile long *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
I looked in the code and I founded the following :

Code: Select all

#ifdef HAVE_OLD_INTERLOCKEDCOMPAREEXCHANGE
    void *tmp = ::InterlockedCompareExchange(OFreinterpret_cast(void **, p),
            OFreinterpret_cast(void *, comp), OFreinterpret_cast(void *, set));
    ret = OFreinterpret_cast(LONG, tmp);
#else
    ret = ::InterlockedCompareExchange(p, comp, set);
#endif
I searched the #define HAVE_OLD_INTERLOCKEDCOMPAREEXCHANGE and I founded it in config\osconfig.h.
I commented out :
//#define HAVE_OLD_INTERLOCKEDCOMPAREEXCHANGE
and compilation went OK !

What is wrong ? Do I made a mistake ?
Thanks in advance for your anwser.

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

#2 Post by Uli Schlachter »

HAVE_OLD_INTERLOCKEDCOMPAREEXCHANGE is 'protected' by:

Code: Select all

#ifdef _MSC_VER
#if _MSC_VER <= 1200 /* Additional settings for VC6 and older */
Which version are you using? Are you using Visual Studio at all?
If you are using VC6, do you know why it isn't using the "old" prototype? Perhaps you replaced the bundled SDK?

Uli

christian desir
Posts: 12
Joined: Mon, 2010-01-11, 15:21

#3 Post by christian desir »

I used Visual C++ 6.0 service pack 6

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest