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. Linking GSL library to Qt App on Windows
Forum Updated to NodeBB v4.3 + New Features

Linking GSL library to Qt App on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
windows10qt6.3.1static linkingexternal librar
6 Posts 3 Posters 742 Views 1 Watching
  • 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.
  • Y Offline
    Y Offline
    YoungCaveMan
    wrote on 20 Apr 2023, 17:04 last edited by
    #1

    Hi everyone,

    I have been trying to link GSL library (https://www.gnu.org/software/gsl/doc/html/usage.html) to an application I am building in Qt (Qt 6 6.3.1).

    I got the source files of GSL library preprad to be compiled for windows from https://github.com/BrianGladman/gsl and I tested the compiled libraries, They work fine on Visual Studio.

    In Qt, the lines added to the .pro file to statically link the library are:

    Screenshot.png

    When I compile and build the app, I recevie an error of the type "undefined reference to". I understan this means there is something wrong with linking, though I am not sure how to debug any further, any suggestions.

    I can share the library files if that is allowed

    Thank you

    S 1 Reply Last reply 20 Apr 2023, 18:39
    0
    • Y YoungCaveMan
      21 Apr 2023, 20:06

      @SGaist Thank you very much

      I compiled the library using MinGW64 (MSYS 2 MinGW64, the typing
      $ pacman mingw-w64-x86_64-gsl-2.7.1-1)

      I then got the header files and the .a files copied from msys2 to the folder of the app and linked them, still getting the same error. Any suggestions?

      Screen.png

      Thanks again

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Apr 2023, 19:19 last edited by
      #4

      Your .pro file search the libraries in the sources not the build folder.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Y 1 Reply Last reply 23 Apr 2023, 07:43
      0
      • Y YoungCaveMan
        20 Apr 2023, 17:04

        Hi everyone,

        I have been trying to link GSL library (https://www.gnu.org/software/gsl/doc/html/usage.html) to an application I am building in Qt (Qt 6 6.3.1).

        I got the source files of GSL library preprad to be compiled for windows from https://github.com/BrianGladman/gsl and I tested the compiled libraries, They work fine on Visual Studio.

        In Qt, the lines added to the .pro file to statically link the library are:

        Screenshot.png

        When I compile and build the app, I recevie an error of the type "undefined reference to". I understan this means there is something wrong with linking, though I am not sure how to debug any further, any suggestions.

        I can share the library files if that is allowed

        Thank you

        S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 20 Apr 2023, 18:39 last edited by
        #2

        Hi and welcome to devnet,

        Based on what you wrote, you seem to be trying to use a library built with visual studio while building your application with MinGW. If so, this can't work. You can't mix and match compilers when using C++ libraries.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Y 1 Reply Last reply 21 Apr 2023, 20:06
        1
        • S SGaist
          20 Apr 2023, 18:39

          Hi and welcome to devnet,

          Based on what you wrote, you seem to be trying to use a library built with visual studio while building your application with MinGW. If so, this can't work. You can't mix and match compilers when using C++ libraries.

          Y Offline
          Y Offline
          YoungCaveMan
          wrote on 21 Apr 2023, 20:06 last edited by
          #3

          @SGaist Thank you very much

          I compiled the library using MinGW64 (MSYS 2 MinGW64, the typing
          $ pacman mingw-w64-x86_64-gsl-2.7.1-1)

          I then got the header files and the .a files copied from msys2 to the folder of the app and linked them, still getting the same error. Any suggestions?

          Screen.png

          Thanks again

          S 1 Reply Last reply 22 Apr 2023, 19:19
          0
          • Y YoungCaveMan
            21 Apr 2023, 20:06

            @SGaist Thank you very much

            I compiled the library using MinGW64 (MSYS 2 MinGW64, the typing
            $ pacman mingw-w64-x86_64-gsl-2.7.1-1)

            I then got the header files and the .a files copied from msys2 to the folder of the app and linked them, still getting the same error. Any suggestions?

            Screen.png

            Thanks again

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 22 Apr 2023, 19:19 last edited by
            #4

            Your .pro file search the libraries in the sources not the build folder.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            Y 1 Reply Last reply 23 Apr 2023, 07:43
            0
            • S SGaist
              22 Apr 2023, 19:19

              Your .pro file search the libraries in the sources not the build folder.

              Y Offline
              Y Offline
              YoungCaveMan
              wrote on 23 Apr 2023, 07:43 last edited by
              #5

              @SGaist Thank you very much! It works perfectly now

              A 1 Reply Last reply 21 Feb 2024, 07:40
              0
              • Y YoungCaveMan has marked this topic as solved on 23 Apr 2023, 07:43
              • Y YoungCaveMan
                23 Apr 2023, 07:43

                @SGaist Thank you very much! It works perfectly now

                A Offline
                A Offline
                Alex_kr1999
                wrote on 21 Feb 2024, 07:40 last edited by
                #6

                @YoungCaveMan , can you tell, how build and use gsl in qt, step by step?

                1 Reply Last reply
                0

                6/6

                21 Feb 2024, 07:40

                • Login

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