How to compile dmctk3.6.0 with support libraries

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Ryan Dou
Posts: 6
Joined: Thu, 2011-06-09, 16:40
Location: Tianjin, China

How to compile dmctk3.6.0 with support libraries

#1 Post by Ryan Dou »

Hi, I'm a newbie. I used cmake 2.8.4 to create a VS2008 project. At first I create project with default options (/MDd or /MD) without supported libraries in cmake, and compiled dcmtk in VS2008 succesfully. but When I modified the project with supported libraries(downloaded pre-compiled package with /MD:dcmtk-3.6.0-win32-i386-support_MD.zip right?) and compiled in VS2008, it show some errors just like FAQ #26. What's wrong? What can I do next step? Thanks in advance.

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi,

default options are /MT and /MTd. Are you sure you are actually building with /MD /MDd? This is only possible if you had changed the compiler flags within Visual Studio, or in the main CMakeLists.txt.

Michael

Ryan Dou
Posts: 6
Joined: Thu, 2011-06-09, 16:40
Location: Tianjin, China

#3 Post by Ryan Dou »

Hi, Thanks!

I'm sure that I didn't touch anything when I opened the project by cmake-gui.exe, After I clicked the configure button the item of CMAKE_C_FLAGS_DEBUG and CMAKE_CXX_FLAGS_DEBUG = /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1! Is it default options? And the CMakeCache.txt's content that in build path is same as above. It has the lines just like CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 and CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1. I am really confused.

There is a lot of trouble for newbie. Please help me! Thanks a lot!

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

Hey Ryan,

actually these flags are overriden by the "DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS" which is enabled per default. You should only disable this if you set _all_ the compiler flags yourself on top of the CMake standard flags. So usually I can only recommend that to expert users.

So if you open visual studio, select a project like dcmdump and look into the property's Code Generation options, you see the compiler flags that are actually used for compiling. Per default, this is /MT and /MTd. But just be sure and check in Visual Studio.

If you really want /MD and /MDd instead, the best is to change all occurences of these flags in the CMakeLists.txt you find in the root directory.

Michael

Ryan Dou
Posts: 6
Joined: Thu, 2011-06-09, 16:40
Location: Tianjin, China

#5 Post by Ryan Dou »

Hi Michael,

That's cool! I finally succeeded!! Thank you very much for your help!
:D

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest