I'm seeing link errors with items missing from DCMTK libraries

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
thomb
Posts: 93
Joined: Mon, 2024-05-20, 08:10

I'm seeing link errors with items missing from DCMTK libraries

#1 Post by thomb »

I'm converting a project that was using DCMTK 3.5.4 to 3.6.8.
Here are a few examples:
2>dcmjpeg.lib(djdijg12.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall dcmtk::log4cplus::Logger::isEnabledFor(int)const " (?isEnabledFor@Logger@log4cplus@dcmtk@@QBE_NH@Z)
2>dcmjpeg.lib(djdijg16.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall dcmtk::log4cplus::Logger::isEnabledFor(int)const " (?isEnabledFor@Logger@log4cplus@dcmtk@@QBE_NH@Z)
2>dcmnet.lib(dulconst.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall dcmtk::log4cplus::Logger::isEnabledFor(int)const " (?isEnabledFor@Logger@log4cplus@dcmtk@@QBE_NH@Z)
2>dcmnet.lib(dulparse.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall dcmtk::log4cplus::Logger::isEnabledFor(int)const " (?isEnabledFor@Logger@log4cplus@dcmtk@@QBE_NH@Z)
2>dcmjpeg.lib(djcodecd.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall dcmtk::log4cplus::Logger::isEnabledFor(int)const " (?isEnabledFor@Logger@log4cplus@dcmtk@@QBE_NH@Z)

2>dcmnet.lib(dulparse.obj) : error LNK2001: unresolved external symbol "class std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> > & __cdecl dcmtk::log4cplus::detail::get_macro_body_oss(void)" (?get_macro_body_oss@detail@log4cplus@dcmtk@@YAAAV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
2>dcmjpeg.lib(djcodecd.obj) : error LNK2001: unresolved external symbol "class std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> > & __cdecl dcmtk::log4cplus::detail::get_macro_body_oss(void)" (?get_macro_body_oss@detail@log4cplus@dcmtk@@YAAAV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
2>dcmnet.lib(dimse.obj) : error LNK2001: unresolved external symbol "class std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> > & __cdecl dcmtk::log4cplus::detail::get_macro_body_oss(void)" (?get_macro_body_oss@detail@log4cplus@dcmtk@@YAAAV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)


2>dcmnet.lib(dulparse.obj) : error LNK2001: unresolved external symbol "void __cdecl dcmtk::log4cplus::detail::macro_forced_log(class dcmtk::log4cplus::Logger const &,int,class OFString const &,char const *,int,char const *)" (?macro_forced_log@detail@log4cplus@dcmtk@@YAXABVLogger@23@HABVOFString@@PBDH2@Z)
2>dcmjpeg.lib(djcodecd.obj) : error LNK2001: unresolved external symbol "void __cdecl dcmtk::log4cplus::detail::macro_forced_log(class dcmtk::log4cplus::Logger const &,int,class OFString const &,char const *,int,char const *)" (?macro_forced_log@detail@log4cplus@dcmtk@@YAXABVLogger@23@HABVOFString@@PBDH2@Z)

For the logger issues, do I just need to include the oflog.lib when linking on Windows?

thomb
Posts: 93
Joined: Mon, 2024-05-20, 08:10

Re: I'm seeing link errors with items missing from DCMTK libraries

#2 Post by thomb »

Errors after adding oflog.lib

1>dcmdata.lib(dcspchrs.obj) : error LNK2001: unresolved external symbol _set_oficonv_logger_callback
1>dcmdata.lib(dcspchrs.obj) : error LNK2001: unresolved external symbol _get_oficonv_logger_callback
1>ofstd.lib(ofchrenc.obj) : error LNK2001: unresolved external symbol _OFiconv_open
1>ofstd.lib(ofchrenc.obj) : error LNK2001: unresolved external symbol _OFiconv
1>ofstd.lib(ofchrenc.obj) : error LNK2001: unresolved external symbol _OFiconv_close
1>ofstd.lib(ofchrenc.obj) : error LNK2001: unresolved external symbol _OFiconvctl
1>ofstd.lib(ofchrenc.obj) : error LNK2001: unresolved external symbol _OFlocale_charset

thomb
Posts: 93
Joined: Mon, 2024-05-20, 08:10

Re: I'm seeing link errors with items missing from DCMTK libraries

#3 Post by thomb »

I added oficonv.lib and that seems to have gotten rid of the remaining linker errors.
Did I miss something in the INSTALL file that says I should include those libraries?

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

Re: I'm seeing link errors with items missing from DCMTK libraries

#4 Post by Marco Eichelberg »

The INSTALL file does not document library dependencies at all. If you port from a library version published in 2005 to one published in 2023, it should not be too surprising that some things have changed since then :wink:

thomb
Posts: 93
Joined: Mon, 2024-05-20, 08:10

Re: I'm seeing link errors with items missing from DCMTK libraries

#5 Post by thomb »

Is there anything that could be documented when new dependencies are introduced?
How do folks usually find this out when working with changes between more recent versions of the toolkit?

Stop rubbing it in :lol:

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

Re: I'm seeing link errors with items missing from DCMTK libraries

#6 Post by Marco Eichelberg »

See the dependency graph at https://support.dcmtk.org/redmine/proje ... ki/Modules
This represents DCMTK 3.6.4 (i.e. we should update it for 3.6.8 ), but it is still mostly correct.
What is missing there is oficonv, which should be at the bottom between config and ofstd. That module was only introduced with 3.6.8.

thomb
Posts: 93
Joined: Mon, 2024-05-20, 08:10

Re: I'm seeing link errors with items missing from DCMTK libraries

#7 Post by thomb »

Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest