Just posting this quickly in case someone knows this off the top off their head.
I noticed lately that DCMTK probably changed under Slicer. Unfortunately besides some inconveniences (like having to do a clean build of Slicer), there are regressions such as this build error in SlicerRT.
Does anyone know what was the main change in DCMTK that causes this and how to fix it? SlicerRT is one of the most used extensions so it would be imperative to solve this before releasing 5.8 if this requires some change in Slicer itself. Thank you!
As it looks to be a Plastimatch build error I would suggest that SlicerRT developers contact Plastimatch (cc @gregsharp.geo ?Gregory C. Sharp · GitLab) about support for recent DCMTK versions. It appears the upstream specifies in its superbuild project to use DCMTK 3.6.2 so it appears there is currently not explicit support for the DCMTK 3.6.8 version that Slicer is using.
However switching SlicerRT to use Plastimatch 1.10.0 (it currently use 1.9.2) Version 1.10.0 (db24480d) · Commits · plastimatch / plastimatch · GitLab is probably a good starting point as it includes some likely important DCMTK linking fixes. So SlicerRT developers should try that update to keep their extension working well with latest Slicer.
Yes I agree it is a Plastimatch issue. What I’m wondering about is if this apparent API change is something well-known. Otherwise it needs to be investigated. Good to know the Plastimatch used in SlicerRT is not the latest. I’ll start there. Thanks!
I had such a problem a week ago, but after plastimatch update to the latest release the compilation process was successful. I had to turn-off Qt support in plastimatch.
Thanks @Mik. Did you also have this error before turning off Qt support? LINK : fatal error LNK1181: cannot open input file 'ofstd.lib'
The reason I posted this in the first place is that I had to rebuild all Slicers that I had compiled from scratch because of the same error that I now get when trying to build SlicerRT with the latest Plastimatch. So I assumed that this is a common issue that people are aware of.
What I built exactly with the latest SlicerRT (and got the error above) is this branch, which I just pushed after rebasing the previous branch slicerrt-1.9.3-2022.06.15-77b40bd3 on the latest Plastimatch on gitlab (the same hash as what @Mik mentions).
Update: what is strange is that the said file (ofstd.lib) is there (S5R\DCMTK-build\lib\Release\ofstd.lib).
There were link problems between plastimatch and DCMTK, i don’t remember vividly the exact error message, but it was similar.
Everything was done on Linux.
I had to disable Qt support because of plastimatch compilation error of a standalone program called gamma_gui or something like that, i think that issue doesn’t have a connection with linking problem.
Thanks! Yes it seems unrelated. I’m trying to resolve the link errors one by one by adding ${DCMTK_LIBRARIES} to the target libraries of the failing projects, there seems to be some progress (but it’s ugly). I’ll give an update when this is done, there are many projects and I find out what fails one by one.
I’m sorry for the misinformation, i’ve checked everything once again and for some reason i used an old DCMTK version 3.6.6. Now i recompiling both DCMTK and ITK to check plastimatch compilation once again, but i think the linking problem is still there.
Regarding this attempt (adding ${DCMTK_LIBRARIES} into the CMakeLists.txt files of projects that showed the error fatal error LNK1181: cannot open input file 'ofstd.lib'):
I added it to a dozen projects, because it seemed that it fixed the linking of the individual projects where I added them. In the end I reached SlicerRtCommon, and it seems that adding this does not fix that project. I get this when I add it to SlicerRtCommon:
Performing build step for 'inner'
MSBuild version 17.10.4+10fbfbf2e for .NET Framework
Configuring: AdditionalLauncherSettings.ini
LINK : fatal error LNK1181: cannot open input file 'ofstd.lib' [C:\d\_Extensions\SlicerRT_R\inner-build\SlicerRtCommon\
vtkSlicerRtCommon.vcxproj] [C:\d\_Extensions\SlicerRT_R\inner.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'ofstd.lib' [C:\d\_Extensions\SlicerRT_R\inner-build\DoseVolumeHisto
gram\MRML\vtkSlicerDoseVolumeHistogramModuleMRML.vcxproj] [C:\d\_Extensions\SlicerRT_R\inner.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'ofstd.lib' [C:\d\_Extensions\SlicerRT_R\inner-build\Isodose\MRML\vt
kSlicerIsodoseModuleMRML.vcxproj] [C:\d\_Extensions\SlicerRT_R\inner.vcxproj]
I have absolutely no idea how to proceed, because the file is there, and don’t know what could be the reason that it is not found. Maybe this specific target is somehow not exposed? I’m not an expert of CMake unfortunately…
Hi all,
I confirm plastimatch did not compile with the new version of DCMTK, but this was fixed in September (commit 1, commit 2).
In the last palstimatch release (1.10.0) support for ITK 5.3 and DCMTK 3.6.8 was added.
I can compile it Ubuntu and Arch Linux now.
Plastimatch compiles successfully with ITK-5.4 and DCMTK-3.6.8. Linking errors in SlicerRT are the same.
Typical output: /usr/bin/ld: can't find -lofstd: Not such file or directory.
Thank you very much! I integrated the PR with some minor changes. I’m doing a clean build as well to make sure it will work on the factory. Good to know it works on Linux too!