3.6.7 : Problem with linking JpegLS static library on Windows

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

3.6.7 : Problem with linking JpegLS static library on Windows

#1 Post by artemmikheev »

Current status below.
Last edited by artemmikheev on Sun, 2023-02-26, 16:39, edited 4 times in total.

artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

problem linking JpegLS static library

#2 Post by artemmikheev »

On Windows 11 (VS 2022/ x64)
1. Now I am able to compile DCMTK 3.6.7 as several DLLs and able to run my application fine.

BUT.
If I specify to Build as Static Libraries (by specifying CMake flag SHARED_LIBS=OFF, then I am not able fully
link it with my application.
Now there are only 3 errors in linking:

2>dcmjpls.lib(djcodece.obj) : error LNK2019: unresolved external symbol JpegLsEncode referenced in function "private: class OFCondition __cdecl DJLSEncoderBase::compressRawFrame(unsigned char const *,unsigned short,unsigned short,unsigned short,unsigned short,unsigned short,class OFString const &,class DcmPixelSequence *,class OFList<unsigned int> &,unsigned long &,class DJLSCodecParameter const *)const " (?compressRawFrame@DJLSEncoderBase@@AEBA?AVOFCondition@@PEBEGGGGGAEBVOFString@@PEAVDcmPixelSequence@@AEAV?$OFList@I@@AEAKPEBVDJLSCodecParameter@@@Z)
2>dcmjpls.lib(djcodecd.obj) : error LNK2019: unresolved external symbol JpegLsDecode referenced in function "private: static class OFCondition __cdecl DJLSDecoderBase::decodeFrame(class DcmPixelSequence *,class DJLSCodecParameter const *,class DcmItem *,unsigned int,unsigned int &,void *,unsigned int,int,unsigned short,unsigned short,unsigned short,unsigned short)" (?decodeFrame@DJLSDecoderBase@@CA?AVOFCondition@@PEAVDcmPixelSequence@@PEBVDJLSCodecParameter@@PEAVDcmItem@@IAEAIPEAXIHGGGG@Z)
2>dcmjpls.lib(djcodecd.obj) : error LNK2019: unresolved external symbol JpegLsReadHeader referenced in function "private: static class OFCondition __cdecl DJLSDecoderBase::decodeFrame(class DcmPixelSequence *,class DJLSCodecParameter const *,class DcmItem

Below is screenshot of my CMake settings. What am I doing wrong? Thank you.

Image
Last edited by artemmikheev on Sun, 2023-02-26, 16:38, edited 1 time in total.

artemmikheev
Posts: 32
Joined: Mon, 2018-11-12, 20:01

Re: 3.6.7 : Problem with linking Static Libs on Windows

#3 Post by artemmikheev »

I now read the FAQ #27 about the order of the linked libraries.
So I complied with the suggested order:

Iphlpapi.lib NetAPI32.lib WSock32.lib ofstd.lib oflog.lib dcmdata.lib dcmsign.lib dcmnet.lib dcmdsig.lib dcmsr.lib dcmqrdb.lib dcmtls.lib dcmwlm.lib dcmimgle.lib dcmpstat.lib dcmjpls.lib dcmjpeg.lib dcmimage.lib ijg16.lib ijg12.lib ijg8.lib

BTW, what happened to dcmsign.lib? The project for it is present in the source code, but when CMAKE generated the whole solution, the dcmsign project is missing from the solution.

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

Re: 3.6.7 : Problem with linking JpegLS static library on Windows

#4 Post by Marco Eichelberg »

artemmikheev wrote: Sun, 2023-02-26, 16:26 BTW, what happened to dcmsign.lib? The project for it is present in the source code, but when CMAKE generated the whole solution, the dcmsign project is missing from the solution.
You are compiling without OpenSSL support. In that case, the dcmsign library is empty.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest