Hi,
when using CMake in windows XP the MSVC solution is set to statically link to the CRT. My application is also set to /MT. I was wondering if there are any memory problems (or other problems) that could result in this.
For example if you consider
DcmItem::findAndGetElement (const DcmTagKey &tagKey, DcmElement *&element, const OFBool searchIntoSub=OFFalse);
You pass a reference to a pointer of DcmElement which gets created by the function findAndGetElement. I am assuming that I have to free that object when I'm done, correct? So basically you're allocating memory in a library with 1 version of statically linked CRT and freeing it potentially using another version of the CRT. Anyone run into any problems with this? Am I wrong with some of my assumptions?
Thanks for clarifying this for me.
*EDIT* After reading some of the code I see I don't have to free that object returned. But I'd still like a confirmation if there are any problems with statically linking to CRT.
Static or dynamic linking to CRT
Moderator: Moderator Team
-
- OFFIS DICOM Team
- Posts: 1442
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
As far as I know, you can never mix Windows code generated with different CRT settings (e.g. /MT and /MD) - the linker will report an error, and rightly so. The only case where this situation might occur is if you have DCMTK code both in your main application and in a DLL. No idea whether the heap management code is compatible - MSDN should know.
Who is online
Users browsing this forum: Google [Bot] and 1 guest