[Post] use the/MD option to compile DCMTK 3.5.4

Source: Internet
Author: User

Download from DCMTK official website http://dicom.offis.de/dcmtk.php.en:

1. DCMTK source dcmtk-3.5.4.tar.gz

2. Pre-compiled support package dcmtk-3.5.4-win32-i386-md-support.zip, note that this package uses the "multithreaded DLL" option (/MD and/MDD)

3. Create a directory such as E: \ DCMTK. Copy the preceding two packages and decompress them to the current folder.

4. Modify E: \ DCMTK \ dimtk-3.5.4 \ cmakelists.txt and change all/MT and/MTD to/MD and/MDD respectively.

5. Use cmake 2.6 to generate project files. Set the cmake parameter with reference to the description in the E: \ DCMTK \ dcmtk-3.5.4 \ install file

Here, I didn't select OpenSSL and libxml in the support library, mainly because they are optional and the Lib in the support package is not generated by/MD. For details, see offis_readme.txt in the support package.

Set the output library file in the advanced settings of cmake. Otherwise, the output library files are scattered and inconvenient.

Locate "libary_output_path" and set it to E: \ DCMTK \ dcmtk-3.5.4 \ Lib \
Find "executable_output_path", set to E: \ DCMTK \ dcmtk-3.5.4 \ bin \

6. Centralized DCMTK header files. The DCMTK code structure has too many layers, and the header files are scattered in many subdirectories. To facilitate reference, search all. H files under E: \ DCMTK \ dcmtk-3.5.4 \ and copy them to a directory, such as E: \ DCMTK \ include,

7. e: \ DCMTK \ include, E: \ DCMTK \ dcmtk-3.5.4 \ Lib \, E: \ DCMTK \ dcmtk-3.5.4 \ bin \ (maybe not required ), this includes all the required header files and library files developed based on DCMTK.

If DCMTK is compiled in vs2005, there will be a C Runtime conflict in vs2010. The solution is as follows:

Problem: The DCMTK library cannot be used. Many error link 2001 errors are reported during connection, such as unresolved external symbol "_ declspec (dllimport) struct STD :: _ smanip <int> _ cdecl STD: SETW (INT) "(_ imp _? SETW @ STD @ ya? Au? $ _ Smanip @ H @ 1 @ H @ Z) and other errors

Cause: the DCMTK library used in zillion is created from the source code in vs2005 and uses the/MDD option, so they are dynamically connected to the C Runtime that comes with vs2005. However, it is found that C Runtime is very different from vs2005 in vs2010beta. For example, STD: SETW () signs "unresolved external symbol" _ declspec (dllimport) struct STD: _ smanip <int> _ cdecl STD :: SETW (INT) "(_ imp _? SETW @ STD @ ya? Au? $ _ Smanip @ H @ 1 @ H @ Z), but in vs2010beta, It is _ declspec (dllimport) struct STD: _ smanip <__int64> _ cdecl STD :: setj (_ int64) "(_ imp _? Setj @ STD @ ya? Au? $ _ Smanip @ _ j @ 1 @ _ j @ Z). Therefore, some C runtime functions cannot be found during connection execution in vs2010.

Solution: Upgrade the DCMTK library. Because vs2010 is still released, cmake does not support vs2010. Therefore, the source code of DCMTK cannot directly create a vs2010 project. The solution is to directly use cmake to create the vs2005 project of DCMTK and use vs2010 to open and compile the project.

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/okaimee/archive/2010/03/19/5396253.aspx

"Seven" happy, all in Sina's new blog version. Come and try it ~~~ Click to enter ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.