Windows 11/x64. VS 2022
It is resolved for me now, I just wanted to share the fix and perhaps get some explanation?
I had a problem statically linking DCMTK libraries statically to my application.
There were 3 unresolved entries.
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
When the whole DCMTK solution is generated, the dcmjpls.lib project missing the 3 source files .cc from the libcharls folder.
But if you go the the dcmjpls directory and open the dcmjpls solution from that folder it contains the said 3 .cc files!
So I just manually added the 3 files to the dcmjpls project under the DCMTK solution.
Now everything links fine statically.
thank you.
dcmjpls.lib : possible defect in the configuration tool?
Moderator: Moderator Team
-
- Posts: 32
- Joined: Mon, 2018-11-12, 20:01
-
- OFFIS DICOM Team
- Posts: 1507
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Re: dcmjpls.lib : possible defect in the configuration tool?
The files in the libcharls folder are compiled into a separate library, named "libdcmtkcharls.a" on Linux, and "dcmtkcharls.lib" on Windows.
You need to link against this library whenever you link against the static libdcmjpls library. DLLs automatically contain this dependency, static libraries do not.
You need to link against this library whenever you link against the static libdcmjpls library. DLLs automatically contain this dependency, static libraries do not.
Who is online
Users browsing this forum: Bing [Bot] and 0 guests