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. Use GSL library with Qt
Forum Updated to NodeBB v4.3 + New Features

Use GSL library with Qt

Scheduled Pinned Locked Moved Solved General and Desktop
qt 5.15gslexternal librarwindows 7 64 bimingw
5 Posts 2 Posters 2.0k 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.
  • S Offline
    S Offline
    sDmt
    wrote on 22 Aug 2020, 20:01 last edited by
    #1

    Hi,
    I know this question was asked many times before, but I still have troubles in solving this issue.
    what I have done so far:

    • i managed to successfully compile the library using MinGW according the procedure described in this link. As a result, I obtained "C:\gsl-2.6" with four folders in it: bin, include, lib and share. the bin folder contains libgsl-25.dll and libgslcblas-0.dll and lib folder contains: libgsl.a and libgslcblas.a. And the include contains gsl folder with the required headers of the library in it.
    • I made a Qt Widget Application named gslTest and added to it
    win32{
       INCLUDEPATH += C:/gsl-2.6/include/
       INCLUDEPATH += C:/gsl-2.6/lib
       LIBS += -LC:/gsl-2.6/lib -llibgsl -llibgslcblas -lm
    }
    

    So far the project builds without any problem.

    • finally, I tried to implement this example.
    double x = 5.0;
    double y = gsl_sf_bessel_J0 (x);
    

    When I add #include <gsl/gsl_sf_bessel.h> qt recognizes it but i get error message in double y = gsl_sf_bessel_J0 (x);

    gslTest\gslTest\mainwindow.cpp:11: error: undefined reference to `gsl_sf_bessel_J0'
    

    I tried many ways to run this example and this the best I've got.
    Please, any ideal about what is wrong here.
    Thanks in advance.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Aug 2020, 20:12 last edited by
      #2

      Hi,

      The lib in -llibgsl shall be dropped (same for the other libraires.)

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

      S 1 Reply Last reply 22 Aug 2020, 21:29
      0
      • S SGaist
        22 Aug 2020, 20:12

        Hi,

        The lib in -llibgsl shall be dropped (same for the other libraires.)

        S Offline
        S Offline
        sDmt
        wrote on 22 Aug 2020, 21:29 last edited by
        #3

        @SGaist Thanks for the reply.
        Sorry but If i understand correctly. Should I rename the libraries without lib and keep the pro as it is or its the opposite? I tried both and still the same result.
        Please advise.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 22 Aug 2020, 22:51 last edited by
          #4

          No, you should modify your .pro file.

          Are you sure these libraries architecture matches the one from the Qt version you are using ?

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

          S 1 Reply Last reply 22 Aug 2020, 23:44
          1
          • S SGaist
            22 Aug 2020, 22:51

            No, you should modify your .pro file.

            Are you sure these libraries architecture matches the one from the Qt version you are using ?

            S Offline
            S Offline
            sDmt
            wrote on 22 Aug 2020, 23:44 last edited by
            #5

            @SGaist That was my problem. I compiled the libraries with MinGW 32 while my Qt's is MinGW 64. I changed the compiler and the problem is solved.
            Thanks for the help.

            1 Reply Last reply
            2

            3/5

            22 Aug 2020, 21:29

            • Login

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