Results 1 to 4 of 4

Thread: Problem linking against library

  1. #1
    Join Date
    Oct 2011
    Posts
    4
    Qt products
    Qt4

    Default Problem linking against library

    I've got big problems to link against following library: http://www.surina.net/soundtouch/

    I managed to compile a .lib which works with Visual Studio Express 2010.
    But I just don't get it to run with Qt.

    Please help, I lost practically this whole day, trying to get this dam lib working :-/

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem linking against library

    Please help, I lost practically this whole day, trying to get this dam lib working :-/
    Yet you expect us to spend the whole day guessing what the actual problem might be.

  3. #3
    Join Date
    Oct 2011
    Posts
    4
    Qt products
    Qt4

    Default Re: Problem linking against library

    Well, it would have been a useful information, that a MSVC compiled library sometimes just cannot work with Qt's Mingw.
    So I compiled it now with MSYS (after fixing a totally messed up installation) and recieved a half-working library.

    Now I have:
    soundtouch.a
    soundtouch.la
    pkgconfig/soundtouch.pc

    What do I have to do with them?
    I tried to link with "LIBS += -lsoundtouch" which let me compile my project and run it, BUT if I want to debug, it crashes right away with "gdb exited unexpectedly (code 1)"

    Do I have to place the above files at a certain location? I don't know what to do with the .la and the .pc file.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem linking against library

    Quote Originally Posted by PowerPlate View Post
    Well, it would have been a useful information, that a MSVC compiled library sometimes just cannot work with Qt's Mingw.
    Yes, it would have been useful information that you were trying to use a library built with MSVC in a project using MingW. Qt is not a compiler and works equally well with Microsoft, GNU, and other compilers. Unfortunately you didn't provide that information, or any other error/warning/diagnostic information, which was my point. We might have guessed binary incompatibility, or that you had no idea how to link a 3rd party library into an program, or that the library was dynamically linked and not being found at run time, ...
    So I compiled it now with MSYS (after fixing a totally messed up installation) and recieved a half-working library.

    Now I have:
    soundtouch.a
    soundtouch.la
    pkgconfig/soundtouch.pc

    What do I have to do with them?
    Link your application to the soundtouch.a file.
    I tried to link with "LIBS += -lsoundtouch" which let me compile my project and run it,
    Good so you have your linker library search path set correctly for soundtouch.a to be found.
    BUT if I want to debug, it crashes right away with "gdb exited unexpectedly (code 1)"
    Not enough information. Gdb crashes? Your program crashes and gdb reports it? Is a backtrace produced? Any other (error) output? Can you produce a minimal, complete program that reproduces the behaviour? Is the compiler version in your MSYS installation the same compiler, or the same version, as the one you are building your application with?

    Do I have to place the above files at a certain location? I don't know what to do with the .la and the .pc file.
    No. The library is statically linked into your application executable and a copy is not needed on the target machine. The other two files are information files for other utilities (libtools and pkgconfig) that can be used to configure projects that need to find the library.
    Last edited by ChrisW67; 15th October 2011 at 03:05.

Similar Threads

  1. linking .so library in Qt on Mac Platform.
    By syclopse in forum Qt Programming
    Replies: 0
    Last Post: 18th August 2011, 10:50
  2. Linking Qt in a dynamic library
    By dave_mm0 in forum Qt Programming
    Replies: 4
    Last Post: 18th July 2009, 16:28
  3. Help needed linking to library
    By StephenR in forum Qt Programming
    Replies: 4
    Last Post: 3rd July 2009, 08:50
  4. linking qt3 to a library
    By thebra in forum Newbie
    Replies: 10
    Last Post: 11th November 2006, 01:25
  5. import library linking
    By bruce1007 in forum Qt Programming
    Replies: 6
    Last Post: 19th May 2006, 10:27

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.