Results 1 to 2 of 2

Thread: using a staticlib

  1. #1
    Join Date
    Oct 2009
    Posts
    16
    Qt products
    Qt4
    Platforms
    Windows

    Default using a staticlib

    Hi,

    My global project build a static lib with the following .pro file:

    Qt Code:
    1. TARGET = kissfft
    2. TEMPLATE = lib
    3. CONFIG += staticlib
    4.  
    5. [...]
    6.  
    7. DESTDIR = bin
    To copy to clipboard, switch view to plain text mode 

    and an application using the static lib with the following .pro file:

    Qt Code:
    1. LIBS += -Lkissfft/bin -lkissfft
    2. INCLUDEPATH += kissfft
    3. DEPENDPATH += kissfft/bin
    4. PRE_TARGETDEPS += kissfft/bin
    To copy to clipboard, switch view to plain text mode 

    I'm using Qt Creator 2.6.0 / Qt5b2 with MSVC2010 compiler.

    As soon as I try to build my project, I get the following link errors:

    Qt Code:
    1. buffer.obj:-1: erreur : LNK2019: unresolved external symbol "void __cdecl kiss_fftr(struct kiss_fftr_state *,float const *,struct kiss_fft_cpx *)" (?kiss_fftr@@YAXPAUkiss_fftr_state@@PBMPAUkiss_fft_cpx@@@Z) referenced in function "public: virtual void __thiscall threadR2C::run(void)" (?run@threadR2C@@UAEXXZ)
    2.  
    3. texbuffer.obj:-1: erreur : LNK2001: unresolved external symbol "void __cdecl kiss_fftr(struct kiss_fftr_state *,float const *,struct kiss_fft_cpx *)" (?kiss_fftr@@YAXPAUkiss_fftr_state@@PBMPAUkiss_fft_cpx@@@Z)
    To copy to clipboard, switch view to plain text mode 

    Sounds strange since I'm using the same compiler in both case (lib and app). Any idea ?

    NB: The function the linker cannot find (kiss_fftr) is not a function from the global header of the library, but a function within the library, called by a global function of that library.

  2. #2
    Join Date
    Oct 2009
    Posts
    16
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: using a staticlib

    Problem solved: I missed a define in the application .pro that was present in the library .pro - so the header code of the library wasn't exactly the same in the lib and app...

Similar Threads

  1. Replies: 1
    Last Post: 15th August 2010, 13:12
  2. strange behaviour: own staticlib and images
    By BeS in forum Qt Programming
    Replies: 4
    Last Post: 3rd April 2009, 00:17
  3. using QTimer in staticlib
    By jeetu_happy in forum Qt Programming
    Replies: 4
    Last Post: 22nd January 2007, 10:34
  4. Build qsqlodbc ODBC staticlib not possibel...
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 27th October 2006, 08:02

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
  •  
Qt is a trademark of The Qt Company.