Hello, since I cannot get dcmtk3.6.3 working under a single dll and I have to go back to static library. I have to use /MD option since my project all compiled under /MD.
I had a test program which works under debug+debug lib, release+release lib. However it does not work under any other combinations. It just crashes when there is any dynamic memory allocation in the library causing heap corruption.
My problem is: I have to use dcmtk in my application with _ITERATOR_DEBUG_LEVEL=0 (some of my dll modules have to be run under release mode to keep performance). This drives me to use release version dcmtk library to work with my application. However, it crashes the same.
For example, the storescu will crash:
if (OFStandard::fileExists(currentFilename)) when the OFFilename destructor is called. The obj is constructed using strdup and destructed using free.
According to research, this kind of error might be due to different version of CRT.
Anybody has any clue on this?
static lib compiled with /MD option problem
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: static lib compiled with /MD option problem
You should first try to compile the DCMTK with CMake option DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS disabled (set to "OFF"). This should set the code generation option of Visual Studio to /MD.
Re: static lib compiled with /MD option problem
Yes, I generate the dcmtk library with /MD exactly by the way you mentioned
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: static lib compiled with /MD option problem
I personally never used _ITERATOR_DEBUG_LEVEL=0 but, maybe, you also need to compile the DCMTK with this setting?
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot] and 1 guest