参考dcmtk官方论坛
的这个帖子
http://forum.dcmtk.org/viewtopic.php?t=36
The DCMTK libraries have the following internal dependencies (modules introduced with DCMTK 3.6.0 are not listed here):
dcmdata : ofstd
dcmimage : dcmimgle, dcmdata, ofstd
dcmimgle : dcmdata, ofstd
dcmjpeg : ijg8, ijg12, ijg16, dcmimage, dcmimgle, dcmdata, ofstd
dcmnet : dcmdata, ofstd
dcmpstat : dcmimage, dcmimgle, dcmsign, dcmsr, imagectn, dcmtls, dcmnet, dcmdata, ofstd
dcmsign : dcmdata, ofstd
dcmsr : dcmdata, ofstd
dcmtls : dcmnet, dcmdata, ofstd
dcmwlm : dcmnet, dcmdata, ofstd
imagectn/dcmqrdb : dcmnet, dcmdata, ofstd
In addition to the standard libraries, most DCMTK applications have to be linked against the "netapi32" and "wsock32" libraries, even if they contain no networking code. Several external libraries such as zlib, OpenSSL etc. might also be needed. See the INSTALL file for details.
按照正确的依赖顺序把库文件加入 项目属性 -> 链接器 -> 输入 -> 附加依赖项 之后,编译通过,可以运行。
The DCMTK libraries have the following internal dependencies (modules introduced with DCMTK 3.6.0 are not listed here):
dcmdata : ofstd
dcmimage : dcmimgle, dcmdata, ofstd
dcmimgle : dcmdata, ofstd
dcmjpeg : ijg8, ijg12, ijg16, dcmimage, dcmimgle, dcmdata, ofstd
dcmnet : dcmdata, ofstd
dcmpstat : dcmimage, dcmimgle, dcmsign, dcmsr, imagectn, dcmtls, dcmnet, dcmdata, ofstd
dcmsign : dcmdata, ofstd
dcmsr : dcmdata, ofstd
dcmtls : dcmnet, dcmdata, ofstd
dcmwlm : dcmnet, dcmdata, ofstd
imagectn/dcmqrdb : dcmnet, dcmdata, ofstd
In addition to the standard libraries, most DCMTK applications have to be linked against the "netapi32" and "wsock32" libraries, even if they contain no networking code. Several external libraries such as zlib, OpenSSL etc. might also be needed. See the INSTALL file for details.
大意就是说dcmtk的库文件之间是有依赖关系的,所以在依赖的时候必须按照一定的顺序来。
上面冒号左边的库文件就是依赖于冒号右边的库文件的。
值得注意的是dcmjpeg这一行,可以看到它依赖于ijg8, ijg12, ijg16, dcmimage, dcmimgle, dcmdata, ofstd。
但是!我们看到上面两行,dcmimage是依赖于dcmimgle的。
所以,如果要添加dcmjpeg,正确的顺序应该是:oflog.lib;dcmdata.lib;ijg8.lib;ijg12.lib; ijg16.lib;dcmimgle.lib;dcmimage.lib;dcmjpeg.lib;。加粗的地方的顺序和上面是反过来的
若要添加别的库文件以此类推
按照正确的依赖顺序把库文件加入 项目属性 -> 链接器 -> 输入 -> 附加依赖项 之后,编译通过,可以运行。