Cmake issue with minc

Hello,

I’ve recently followed the instructions on ITK’s page to install it via vcpkg. I’ve included the necessary commands:
find_package(ITK REQUIRED) and ${ITK_LIBRARIES} in my target link. However, I get a linking error related to minc2.dll (":-1: error: LNK1181: cannot open input file ‘minc2.lib’). I can confirm that the lib is located with all the other libs in vcpkg’s install folder in my project, but for some reason this linking error persists. Am I supposed to be linking against something related to minc as well? My code is a very simple hello world example:

    using ImageType = itk::Image<unsigned short, 3>;
    auto image = ImageType::New();
    std::cout << "ITK Hello World !" << std::endl;

Alternatively, I can set my cmake to the suggested output of vcpkg: namely the same find_package and link against ITKFFT ITKVTK ITKznz itksys. However, when trying to run a simple example of writing an image (Write an Image — v5.4.0), I get a number of unresolved external symbols related to the writer like the one below:
main_window.cpp.obj:-1: error: LNK2019: unresolved external symbol “__declspec(dllimport) public: void __cdecl itk::ImageIOBase::SetNumberOfDimensions(unsigned int)” (_imp?SetNumberOfDimensions@ImageIOBase@itk@@QEAAXI@Z) referenced in function “public: virtual void __cdecl itk::ImageFileWriter<class itk::Image<unsigned short,1> >::Write(void)”

Any thoughts would be appreciated. Thanks!

This sounds like a broken ITK build. Or it might be related to vcpkg. Try a clean build.

In case this is still relevant: minc2 depends on hdf5 and netcdf. I’d expect vcpkg to handle these dependencies, if minc2 was installed through it (I don’t have easy access to vcpkg to check myself).

I’m now hitting this same problem. vcpkg appears to correctly build MINC, and libminc2.a (I’m on Mac) is present in the vcpkg lib/ directory. However, vcpkg does not print any useage information for minc, which is not a good sign. I suspect the CMake module for minc is incomplete or missing. This means it’s not possible to use ITKImageIO out of the box with vcpkg, as far as I can tell.