1

Hi guys ~ I am doing some work about testing my program that using DCMTK to load Dicom File and other stuff . However I find that my program could only work in debug mode . When I change to release mode ,that occured error below

DCMTK ofstd.lib(ofmath.obj):-1: error: LNK2038: detect "RuntimeLibrary" unmatch: value "MDd_DynamicDebug"no match value "MD_DynamicRelease"(in main.obj)

There are Plenty of error like this.

In visual studio 2015, I change my project runtime to MDd mode in Release mode. This is quite wired!! I consider MDd belonging to Debug Mode ,however this is the only way I could run my program in release mode in VS2015.

The largest problem occurred in Qt Creator . No matter what runtime I choose ,MD or MDd , I just can't let it work in release mode. So I wonder if someting wrong with my DCMTK.

I first only install the debug version of DCMTK, one week later I install the release mode to make it conveient to test in other computer. I find it both installed in the same path. So What can I do that could make it depart. So I could use Debug and Release .

WtDMaO
  • 13
  • 2
  • 2
    Don't install them in the same path? And then have your debug version refer to the debug library of Dcmtk and use the release library of Dcmtk for your release version. – André Apr 26 '18 at 12:06

1 Answers1

1

In order to install the Release and Debug build of the DCMTK into the same directory, you could e.g. set the advanced CMake option CMAKE_DEBUG_POSTFIX to "_d" (default is "").

Also I would suggest to build the DCMTK with CMake option DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS set to "OFF" (when integrating the DCMTK with another library such as Qt). This lets CMake find out the "best" compiler settings (instead of overwriting them with the DCMTK defaults for VisualStudio).

J. Riesmeier
  • 1,641
  • 10
  • 14