Results 1 to 8 of 8

Thread: How to use a library (LAPACK) with Qt? (Windows)

  1. #1
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to use a library (LAPACK) with Qt? (Windows)

    This is a real beginner question - I've never used Qt on Windows before. I want to use the LAPACK library with Qt. I've placed "LIBS += -llapack" in my .pro file, but how do I get Qt to know where the LAPACK library is located?

    I have Vista 64.

  2. #2
    Join Date
    Jan 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to use a library (LAPACK) with Qt? (Windows)

    Assuming that the library name is right... You don't have to do anything if the library is in your windows PATH. Otherwise you will have to use -L to tell Qt where it is located

  3. #3
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use a library (LAPACK) with Qt? (Windows)

    You have to set the DEPENDPATH and the INCLUDEPATH in your .pro.

  4. #4
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use a library (LAPACK) with Qt? (Windows)

    Thanks. I installed LAPACK for Windows, and have the text below as part of my .pro file. But the compiler still can't find -llapack. What's my mistake?

    DEPENDPATH += .
    DEPENDPATH += C:\Program Files (x86)\University Of Tennessee\LAPACK 3.1.1\lib\x64
    INCLUDEPATH += .
    INCLUDEPATH += C:\Program Files (x86)\University Of Tennessee\LAPACK 3.1.1\lib\x64

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to use a library (LAPACK) with Qt? (Windows)

    Try something like this:
    INCLUDEPATH += "C:\Program Files (x86)\University Of Tennessee\LAPACK 3.1.1\include
    LIBS += -L"C:\Program Files (x86)\University Of Tennessee\LAPACK 3.1.1\lib\x64" -llapack
    J-P Nurmi

  6. #6
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use a library (LAPACK) with Qt? (Windows)

    Thank you very much, that worked.

    Is there a way to conditionally include that in the .pro file, so that the same .pro file would work on both Windows (where those includes are necessary) and Linux (where a simple -llapack works)?

  7. #7
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to use a library (LAPACK) with Qt? (Windows)

    Yes, by using scopes. See the qmake manual.

    Basically, add this to your .pro file:
    Qt Code:
    1. win32 {
    2. INCLUDEPATH += "C:\Program Files (x86)\University Of Tennessee\LAPACK 3.1.1\include
    3. LIBS += -L"C:\Program Files (x86)\University Of Tennessee\LAPACK 3.1.1\lib\x64" -llapack
    4. }
    To copy to clipboard, switch view to plain text mode 

  8. #8
    Join Date
    Jan 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use a library (LAPACK) with Qt? (Windows)

    Thanks a lot for the help

Similar Threads

  1. plugin in a library
    By alisami in forum Qt Programming
    Replies: 2
    Last Post: 3rd October 2008, 17:21
  2. Linking problems with QT4 under Windows
    By Ancalagon in forum Qt Programming
    Replies: 2
    Last Post: 8th September 2008, 13:29
  3. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 14:52
  4. MinGW Windows Library Search Path
    By zztop in forum Qt Programming
    Replies: 4
    Last Post: 26th March 2006, 15:18
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 22:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.