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).