FAQ #27: Compilation of DCMTK-based program fails with LNK2001 [MSVC]

Frequently Asked Questions regarding DCMTK

Moderator: FAQ Team

Post Reply
Message
Author
Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1435
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

FAQ #27: Compilation of DCMTK-based program fails with LNK2001 [MSVC]

#1 Post by Marco Eichelberg »

:?: I am developing an application on Microsoft Visual C++ (MSVC) that uses DCMTK. When I try to compile and link my application against the DCMTK libraries, the linker fails with error LNK2001, e.g.

Code: Select all

dcmdata.lib(dcuid.obj) : error LNK2001: unresolved external symbol _Netbios@4 
:!: You are not linking all of the libraries needed, or you are linking in wrong order (library link order is significant!)
The DCMTK libraries have the following internal dependencies (modules introduced with DCMTK 3.6.0 are not listed here):
  • dcmdata :arrow: ofstd
  • dcmimage :arrow: dcmimgle, dcmdata, ofstd
  • dcmimgle :arrow: dcmdata, ofstd
  • dcmjpeg :arrow: ijg8, ijg12, ijg16, dcmimage, dcmimgle, dcmdata, ofstd
  • dcmnet :arrow: dcmdata, ofstd
  • dcmpstat :arrow: dcmimage, dcmimgle, dcmsign, dcmsr, imagectn, dcmtls, dcmnet, dcmdata, ofstd
  • dcmsign :arrow: dcmdata, ofstd
  • dcmsr :arrow: dcmdata, ofstd
  • dcmtls :arrow: dcmnet, dcmdata, ofstd
  • dcmwlm :arrow: dcmnet, dcmdata, ofstd
  • imagectn/dcmqrdb :arrow: 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.

Also see the following figure which should always be up-to-date with regard to the DCMTK modules.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest