Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED] NetCDF



  • Hi All:

    I'm wondering if anyone has had any success working with NetCDF and the mingw version of Qt. I haven't really found any topics on here related to NetCDF. I know Unidata provides a set of libraries built with the Visual Studio C compiler, however, I don't have a license for that compiler.

    This is where my inexperience comes through. Is it possible to:
    (1) Use the visual studio built libraries with the mingw Qt, and if so...
    (2) Can I call those C routines from Qt?

    Thanks!


  • Lifetime Qt Champion

    Hi,

    Did you consider using the Visual Studio Express edition ? It's free to use



  • If it is a pure C interface then you should be able to use the binary DLLs in your MingW-based project by linking directly against the DLL (rather than the MSVC link library). Failing that you can use the MSVC compilers found in the Windows Sdk 7.1 (not 8+) or the current Visual Studio Express edition.



  • Thanks for the help guys. After some digging, I found that the whole reason I couldn't get it to work was that there were further libraries required by the NetCDF library that I wasn't including in my build. The C based libraries do work just fine as ChrisW67 predicted and pull into Qt without any issues thus far.

    Adding:

    @
    LIBS += -LC:/netcdf/bin_qt -lnetcdf -lhdf5 -lz -lcurl
    INCLUDEPATH += C:/netcdf/include
    @

    Corrected the problem where "bin_qt" contains the following dll's:

    netcdf.dll

    hdf5.dll

    hdf5_hl.dll

    libcurl.dll

    szip.dll

    zlib.dll

    zlib1.dll

    And "include" contains:

    netcdf.h

    Thanks for helping push me down the right path.


Log in to reply