ITK with DCMTK building error

A patch has been merged in ITK and should solve the MacOS build issue you had. Do you have a small project you could share to test your link error on Windows?

3 Likes

Great ! Thanks for your commitment on this François. I will try ASAP and report the outcome.

That really simple, with a master version downloaded on Jan 22 (after Matt commit updating DCMTK) this MWE will show the errors:

#include <itkDCMTKSeriesFileNames.h>

int main(int argc, char *argv[])
{
	itk::DCMTKSeriesFileNames::Pointer NameGenerator = itk::DCMTKSeriesFileNames::New();

	return 1;
}
1 Like

Actually, the patch that I mentioned in my previous message did not correct your problem, but this new one should. Let me know if it is the case.

1 Like

The patch has solved the linking error on Windows :slight_smile:. Thank you !
On debug config there is just a bunch of warnings:

2>icuucd.lib(putil.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(putil.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(umath.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(umath.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(utypes.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(utypes.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uinvchar.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uinvchar.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(umutex.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(umutex.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucln_cmn.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucln_cmn.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uobject.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uobject.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(cmemory.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(cmemory.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(charstr.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(charstr.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(udata.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(udata.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucmndata.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucmndata.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(udatamem.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(udatamem.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(umapfile.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(umapfile.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(udataswp.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(udataswp.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucol_swp.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucol_swp.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(utrace.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(utrace.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uhash.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uhash.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uenum.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uenum.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ustrenum.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ustrenum.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uvector.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uvector.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_bld.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_bld.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_cnv.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_cnv.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_io.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_io.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_cb.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_cb.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_err.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_err.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnvlat1.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnvlat1.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_u7.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_u7.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_u8.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_u8.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_u16.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_u16.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_u32.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_u32.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnvscsu.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnvscsu.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnvbocu.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnvbocu.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_ext.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_ext.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnvmbcs.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnvmbcs.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv2022.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv2022.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnvhz.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnvhz.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_lmb.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_lmb.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnvisci.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnvisci.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ucnv_ct.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ucnv_ct.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(resource.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(resource.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uresbund.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uresbund.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uresdata.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uresdata.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(locmap.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(locmap.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uloc.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uloc.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(locid.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(locid.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(stringpiece.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(stringpiece.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(appendable.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(appendable.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ustr_cnv.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ustr_cnv.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(unistr.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(unistr.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(utf_impl.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(utf_impl.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ustring.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ustring.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(cstring.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(cstring.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ustrfmt.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ustrfmt.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(ustrtrns.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(ustrtrns.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(utrie2.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(utrie2.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uarrsort.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uarrsort.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(wintz.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(wintz.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uloc_tag.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uloc_tag.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info
2>icuucd.lib(uloc_keytype.ao) : warning LNK4099: PDB 'vc140.pdb' was not found with 'icuucd.lib(uloc_keytype.ao)' or at 'C:\Code\speedtest\builds\Debug\vc140.pdb'; linking object as if no debug info 

These seem to be more a ICU problem. I haven’t tried to build without.

The bad news are on MacOS side : the master still fail during build with the very same error.

1 Like

Just as a side question rather than opening a new topic, I’ve noticed that there are inconsistent behaviors between the GDCM/DCMTK SeriesFileNames:
the GetSeriesUIDs method of the former return a list of uniques UIDs found whereas the DCMTK one return all UIDs. Is it expected to stay as it is due to underlying differences ?

Thanks for testing. The warnings could be solved easily I think if I was packaging the pdb file in the ICU package that I create. I am still unsure that this patch is THE solution. I want to understand what is actually happening before I merge it, so it might take a couple of days before master works on Windows again.
I am surprised about the MacOS issue as another ITK developer had an issue with MacOS a couple days ago, and his issue seemed to be solved with one of the recent patches. I’ll take a look at it again.
As for the differences between DCTMK and GDCM, I don’t know, but maybe @blowekamp or @matt.mccormick will have an idea.

1 Like

The API between GDCM/DCMTK SeriesFileNames may not be the same, but this was intended. Some improvements were made in the DCMTK case.

1 Like

As far as I’m concerned, the current workaround is sufficient to fiddle with my project.
Note that building ITK with a “system” DCMTK still works in the master, so users still can use it.
It is just the fact that you guys make configuration setup way easier with the ITK bundling :+1:.
So many thanks !

Good to know, as the documentation isn’t really clear on that. Thanks Matt!

@tim-evain The current work around is incomplete and would need more work to be integrated in ITK:

  • The precompiled ICU packages would need to be re-created to include the missing DLL (icudt.dll).
  • The missing DLL needs to be installed in the correct location in ITK build tree.
  • The missing DLL needs to be installed in the correct location in the ITK install tree.

My question for you is: Do you need ICU?
I could also disable the compilation of ICU on Windows inside ITK. The user could then either build DCMTK without ICU (like it is already done in some projects using ITK, e.g. 3D Slicer), or provide their own version of ICU and manage it themselves.

Not at the moment. I’ve built with it “just in case”, but it is not mandatory for my project now.

I think this is a nice solution to be sure to have a working build in the master. This way, you will have time to see if ICU can be made afterward.

1 Like

@tim-evain: The new version of the patch disables ICU both on Windows and MacOS. This should solve your problems on both platforms. Please let me know if you are able to test it and if it resolves your issues. The patch is available here.

Thanks!

1 Like

@fbudin

Both issues are effectively solved. Thanks you :slight_smile:

2 Likes

I merged the patch in ITK. Thanks for the report and the testing. The integration of DCMTK is likely going to change a bit in the coming months. I have some ideas to try to simplify the current implementation:

  • Remove ICU from ITK and let the user deal with special compilations of DCMTK on their own.
  • Integrate the source code of DCMTK in ITK using some very recent CMake modules.
    I’ll try to update this topic when these changes happen. They are not at the top of my to-do list.
1 Like

hello,
i have this link error as mentioned above.

i see the post is few months ago and i’m using version 3.6.4 of dcmtk, itk 4.13.2.

is the fix in those versions or should i do the patch also?

@eninyo: It doesn’t look like the patch mentioned above made it into 4.13.2. Can you try using the latest version of ITK (5.0rc02 or master) and see if that solves your problem?
Thanks!

@fbudin thanks for your reply.
i want to use formal released version which is itk 4.13.2 as for now.

now the question is how do i apply the patch? (i’m new to it…)
i download the sources and cmake it.
any suggestions?

just to make it clear, the patch is on ITK and not DCMTK, right?
as i see the changes in the patch are in the cmake files only, right?

@eninyo: What is the value of the CMake variable DCMTK_USE_ICU? And what is your development platform (Windows, Mac, Linux)?
If DCMTK_USE_ICU is set to ON, try setting it to OFF and see if that gets rid of your issue.

@fbudin I don’t have this (DCMTK_USE_ICU) at all in the itk cmake.
did you mean dcmtk?

@eninyo: It is both an ITK and a DCMTK option. Since you seem to be building DCMTK outside of ITK, then you should check the value of that option in the DCMTK build tree. However, I think that to address your problem, the other option that I mentioned in this other post is more likely to be helpful.

in cmake of DCMTK ICU is set to false, so I guess it is not the issue.
I will try to add the iphlpapi ws2_32 netapi32 wsock32 libs to the linking.