美文网首页C++
Visual Studio 2015 编译安装DCMTK3.6.

Visual Studio 2015 编译安装DCMTK3.6.

作者: wjh2005dev | 来源:发表于2017-11-02 18:03 被阅读262次

编译环境

Windows 7 64位 中文版

VS2015 + Update3

编译DCMTK为MD版本

1.下载dcmtk3.6.2源代码.

http://dicom.offis.de/dcmtk.php.en

2.下载第三方库.

下载DCMTK 3.6.2 - support libraries for Windows

http://dicom.offis.de/dcmtk.php.en

dcmtk-3.6.2-win32-support_MD-msvc-14.0.zip


Pre-compiled libraries for Visual Studio2015 (MSVC 14.0), 32 bit, with "MD" option

3.下载CMake.

https://cmake.org/download/

下载cmake-3.9.4-win64-x64.zip

4.生成VS2015项目

打开文件dcmtk-3.6.2\src\CMake\dcmtkPrepare.cmake


修改/MTd为/MDd, /MT为/MD


打开CMake,输入Where is the source code和Where to build thebinaries.


点击Configure.



修改如下配置:

libxml support:
set "DCMTK_WITH_XML" to "ON" and
set "WITH_LIBXMLINC" e.g. to "D:/OpenSource/dcmtk-3.6.2/support-lib/libxml2-2.9.4"

libpng support:
set "DCMTK_WITH_PNG" to "ON" and
set "WITH_LIBPNGINC" e.g. to "D:/OpenSource/dcmtk-3.6.2/support-lib/libpng-1.6.30"

libtiff support:
set "DCMTK_WITH_TIFF" to "ON" and
set "WITH_LIBTIFFINC" e.g. to "D:/OpenSource/dcmtk-3.6.2/support-lib/libtiff-4.0.8"

OpenSSL support:
set "DCMTK_WITH_OPENSSL" to "ON" and
set "WITH_OPENSSLINC" e.g. to "D:/OpenSource/dcmtk-3.6.2/support-lib/openssl-1.1.0f"

zlib support:
set "DCMTK_WITH_ZLIB" to "ON" and
set "WITH_ZLIBINC" e.g. to "D:/OpenSource/dcmtk-3.6.2/support-lib/zlib-1.2.11"

libiconv support:
set "DCMTK_WITH_ICONV" to "ON" and
set "WITH_LIBICONVINC" e.g. to "D:/OpenSource/dcmtk-3.6.2/support-lib/libiconv-1.15"

注意:文件夹路径必须使用’/’作为分隔符.否则CMake执行过程中会产生错误.

点击Generate生成项目.

5.打开DCMTK.sln.

打开dcmtk-3.6.2\dcmtk-msvc14\DCMTK.sln,选择项目”ALL_BUILD”,开始Build.


编译完成后,选择项目”INSTALL”,执行Build.

6.特殊情况处理.

6.1执行”INSTALL”时发生错误

打开dcmtk-3.6.2\dcmtk-msvc14\dcmnet\apps\cmake_install.cmake,修改openssl的相关文件如下:

if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "bin" OR NOT CMAKE_INSTALL_COMPONENT) file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE FILE FILES "D:/OpenSource/dcmtk-3.6.2/support-lib/openssl-1.1.0f/bin/dcmtkcrypto-1_1.dll" "D:/OpenSource/dcmtk-3.6.2/support-lib/openssl-1.1.0f/bin/dcmtkssl-1_1.dll" ) endif()

相关文章

网友评论

    本文标题:Visual Studio 2015 编译安装DCMTK3.6.

    本文链接:https://www.haomeiwen.com/subject/jirapxtx.html