Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MingW, MSVC, GFortran: Link libraries
Qt 6.11 is out! See what's new in the release blog

MingW, MSVC, GFortran: Link libraries

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fem_dev
    wrote on last edited by
    #1

    I'm developing a main Qt GUI C++ application that calls some Fortran-90 functions and subroutines inside of it.

    This application must be cross-platform: Windows, Linux and Mac OSX.

    I know that my C++ compiler MUST be compatible with my Fortran compiler.
    So, to build my application I'm thinking of use these combinations below:

    For Windows 10:

    • C++: MSVC++ 2019
    • Fortran: Intel Fortran Compiler 2019

    For Linux (Ubuntu 20.04):

    • C++: GCC 9.3
    • Fortran: gfortran 9.3

    For OSX:

    • C++: GCC 9.3
    • Fortran: gfortran 9.3

    Looking this info above, I think that will be good to try to use a single compilers pair to ALL targets.

    So, using Qt Maintenance I downloaded and installed the Mingw-w64-8.1 compilers and tools.

    My first problem using the Qt + MingW is that:
    My Qt project need to link some libraries.
    The Windows compiled static libraries are in the project folder and the file extension is *.lib
    The Linux and OSX libraries are in the project include paths.

    Trying to build a Windows binary with GCC:

    When I use Qt + MSVC...I got no linker errors and all works fine.
    But when change the Qt configurations to use Qt + Mingw the linker starts to search for a *.a library and NOT a *.lib library.

    I'm a little bit confuse. I downloaded MingW to be possible to generate Windows builds using GCC. In that way, I think that the linker libraries should be the same as always *.lib. Right?

    What is wrong?

    Thank,

    My systems are:

    System A:

    • Windows 10 x64
    • Qt Creator 4.12.4
    • Qt 5.15

    System B:

    • Ubuntu 20.04 x64
    • Qt Creator 4.12.4
    • Qt 5.15

    System C:

    • OSX Catalina
    • Qt Creator 4.12.4
    • Qt 5.15
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @fem_dev said in MingW, MSVC, GFortran: Link libraries:

      Right?

      No.

      MSVC uses .lib suffix for import libs, MinGW/gcc .a
      And since you can't mix MSVC and MinGW/gcc c++ libraries you have to compile all dependencies with the same compiler.

      use a single compilers pair to ALL targets.

      I don't understand this - do you try to cross-compile?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      F 1 Reply Last reply
      6
      • Christian EhrlicherC Christian Ehrlicher

        @fem_dev said in MingW, MSVC, GFortran: Link libraries:

        Right?

        No.

        MSVC uses .lib suffix for import libs, MinGW/gcc .a
        And since you can't mix MSVC and MinGW/gcc c++ libraries you have to compile all dependencies with the same compiler.

        use a single compilers pair to ALL targets.

        I don't understand this - do you try to cross-compile?

        F Offline
        F Offline
        fem_dev
        wrote on last edited by
        #3

        @Christian-Ehrlicher Ok! I understood now.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved