原帖地址:http://www.cnblogs.com/yinxufeng/p/3636241b7084b0340cc56fd37f9e2fd8.html
下载源码
DCMTK3.6.1源码以及最新下载下载地址:
ftp://ftp.dcmtk.org/pub/dicom/offis/software/dcmtk/snapshot/支持库下载地址:
http://www.dcmtk.org/dcmtk.php.en
dcmtk-3.6.0-win32-i386-support_MT
ordcmtk-3.6.0-win32-i386-support_MD
Cmake:
https://cmake.org/download/
下载绿色版:Windows ZIP
生成VS项目工程
- 设置
source code
路径: “E:/libsupport/dcmtk-3.6.1/dcmtk-3.6.1_20160216” - 设置
binaries
路径: “E:/libsupport/dcmtk-3.6.1/dcmtk-3.6.1_20160216_vs2008” - 点击
Configure
,选择visual studio 2008(或者其他已经安装的版本) - 等待Configure完毕
- 红色区域设置,选中
Advance
:- 搜索”install”,修改
CMAKE_INSTALL_PREFIX
路径: “E:/libsupport/dcmtk-3.6.1/dcmtk-3.6.1_20160216_vs2008/install” - 搜索”modules”,修改
DCMTK_MODULES
,自定义需要生成的模块
(默认是:ofstd;oflog;dcmdata;dcmimgle;dcmimage;dcmjpeg;dcmjpls;dcmtls;dcmnet;dcmsr;dcmsign;dcmwlm;dcmqrdb;dcmpstat;dcmrt;dcmiod;dcmfg;dcmseg
我目前只用到了ofstd;oflog;dcmdata;dcmimgle;dcmimage;dcmjpeg) - 从3.6.1开始支持生成dll了,只要勾选上
BUILD_SHARED_LIBS
;如果想最终只生成一个单独的”“,再勾选上BUILD_SINGLE_SHARED_LIBRARY
- 搜索”cxx”,根据需要修改编译选项为MD/MT
- 搜索”install”,修改
- 点击
Generate
,生成VS工程
编译源码
- 用VS打开”e:libsupportdcmtk-3.6.1dcmtk-3.6.1_20160216_vs2008DCMTK.sln”
- 根据自己需要选择项目Configuration为Debug/Release
- 生成
ALL_BUILD
- 生成
INSTALL
,完毕后将在之前设置CMAKE_INSTALL_PREFIX路径下存放DCMTK的include
和lib
库