Dec 17, 2009

Library dependency in DCMTK with MSVC

Quoted from:
DICOM @ OFFIS :: View topic - FAQ #27: Compilation of DCMTK-based program fails with LNK2001 [MSVC]
# 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



And additional link to the libraries of "netapi32.lib" and "wsock32.lib" from microsoft's Platform SDK/Windows SDK(generally included in VC++ installation) are required because some of libraries in the DCMTK uses its functionality.

The first "choke" step for building own application is here. If you forget to link to the "netapi32.lib", the linker will output several errors as like followings:

In English version of VC:
error LNK2019: unsolved link symbol _Netbios@4 is referenced in the function "unsigned char * __cdecl getMACAddress(unsigned char * const)" (?getMACAddress@@YAPAEQAE@Z)
Debug/Xxxx.exe : fatal error LINK1120: There is 1 unsolved external reference.
(This message is manually translated to English from Japanese. so, it may not be exactly same message in actual message emitted from English version of VC.)

In Japanese version of VC:
dcmtk.lib(dcuid.obj) : error LNK2019: 未解決の外部シンボル _Netbios@4 が関数 "unsigned char * __cdecl getMACAddress(unsigned char * const)" (?getMACAddress@@YAPAEQAE@Z) で参照されました。
Debug/Xxxx.exe : fatal error LNK1120: 外部参照 1 が未解決です。

No comments:

Post a Comment