Results 1 to 3 of 3

Thread: problem in adding static lib to pro file

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default problem in adding static lib to pro file

    Hi,

    I need quazip library to be included in my project file. I tried the following syntaxes;


    Qt Code:
    1. CONFIG(debug, debug|release) {
    2. LIBS += -L../SIPC_PJSIP_CLIENT/third_party/quazip-0.4.4/quazip-0.4.4/quazip/debug -lquazipd.lib
    3. } else {
    4. LIBS += -L../SIPC_PJSIP_CLIENT/third_party/quazip-0.4.4/quazip-0.4.4/quazip/release lquazip.lib
    5. }
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. win32:LIBS += ../SIPC_PJSIP_CLIENT/third_party/quazip-0.4.4/quazip-0.4.4/quazip/debug/quazipd.lib
    To copy to clipboard, switch view to plain text mode 


    but I'm getting the "error LNK2019: unresolved external symbol"

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problem in adding static lib to pro file

    I think you don't include '.lib'
    e.g.
    http://doc.qt.nokia.com/qtcreator-2....libraries.html
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    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 in adding static lib to pro file


    You don't say if the linker error message relates to a symbol in the quazip library or not. It pays to post entire error messages.

    The first option should work if, as amleto suggests, you leave the ".lib" off the end of the library name, the relative path is correct, and you correct the missing hyphen on line 4. This may pick a dynamic library in preference to the static library if one is present.

    The second should work as-is if the relative path is correct.

    Try using an absolute path to eliminate the relative path as the problem.

Similar Threads

  1. Build static QT + static SSL problem.
    By makzimi in forum Qt Programming
    Replies: 3
    Last Post: 23rd April 2012, 23:45
  2. Adding videos to .qrc file
    By SeN in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 26th November 2010, 15:38
  3. Adding Library Methods - Static Vs Dynamic
    By waynew in forum Qt Programming
    Replies: 1
    Last Post: 15th January 2010, 16:16
  4. Adding QPushButton to *.ui file by hand
    By s410i in forum Qt Programming
    Replies: 3
    Last Post: 23rd June 2009, 13:08
  5. Adding a new file to moc process in XCode
    By redneon in forum Qt Programming
    Replies: 0
    Last Post: 2nd May 2009, 18:49

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.