Results 1 to 7 of 7

Thread: import library linking

  1. #1
    Join Date
    May 2006
    Posts
    7
    Thanks
    2

    Default import library linking

    Hi all, my app uses a third party dll library under win32 with QT 4.1.2 framework, and I "reimp"ed the import lib to a ".a" library file, but linking problem is occured when i finally built the project.

    Need your help.

    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: import library linking

    Quote Originally Posted by bruce1007
    Hi all, my app uses a third party dll library under win32 with QT 4.1.2 framework, and I "reimp"ed the import lib to a ".a" library file, but linking problem is occured when i finally built the project.

    Need your help.

    thanks
    In your project file (.pro) add this line

    Qt Code:
    1. LIBS += -L<PATH_WHERE_LIB_IS> -l<libname>
    To copy to clipboard, switch view to plain text mode 

    Bye
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    May 2006
    Posts
    7
    Thanks
    2

    Default Re: import library linking

    I have used "LIBS += ..." reference, but the linker reported "undefined reference" error back.

  4. #4
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: import library linking

    Quote Originally Posted by bruce1007
    I have used "LIBS += ..." reference, but the linker reported "undefined reference" error back.
    Can you post the linker output?
    A camel can go 14 days without drink,
    I can't!!!

  5. #5
    Join Date
    May 2006
    Posts
    7
    Thanks
    2

    Default Re: import library linking

    the linker output like below

    debug\form.o(.text+0x1c0): In function `ZN4FormC2EP7QWidget':
    D:/project/study/prac/form.cpp:13: undefined reference to `stopMovie(void*
    debug\form.o(.text+0x2d4): In function `ZN4FormC1EP7QWidget':
    D:/project/study/prac/form.cpp:13: undefined reference to `stopMovie(void*
    collect2: ld returned 1 exit status

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: import library linking

    How does the LIBS line look exactly? Is that a C++ library?

  7. #7
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: import library linking

    Quote Originally Posted by jacek
    How does the LIBS line look exactly? Is that a C++ library?
    If isn't a C++ library, use this syntax

    Qt Code:
    1. extern "C"
    2. {
    3. #include <libinclude>
    4. }
    To copy to clipboard, switch view to plain text mode 
    A camel can go 14 days without drink,
    I can't!!!

Similar Threads

  1. plugin in a library
    By alisami in forum Qt Programming
    Replies: 2
    Last Post: 3rd October 2008, 17:21
  2. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 14:52
  3. Replies: 1
    Last Post: 5th March 2007, 20:50
  4. linking qt3 to a library
    By thebra in forum Newbie
    Replies: 10
    Last Post: 11th November 2006, 01:25
  5. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52

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.