Results 1 to 5 of 5

Thread: Problem when linking with own static libraries

  1. #1
    Join Date
    May 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Problem when linking with own static libraries

    Hello all,

    I'm working under Windows XP.

    I built static library (say it is called MyStaticLib) I would like to use in my application. The building is ok but when I launch my app, the program stops because it can't find the DLL for MyStaticLib. Is there any options I should set in the .pro files to force the compiler to link statically my lib ?

    Thanks,

  2. #2

    Default Re: Problem when linking with own static libraries

    Are you using the QtDesigner?

  3. #3
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem when linking with own static libraries

    Add a CONFIG += static in the pro-file.

    Qt Designer has nothing to do with this problem, as the Designer simply creates ui-files.

  4. #4

    Default Re: Problem when linking with own static libraries

    Quote Originally Posted by Boron View Post
    Add a CONFIG += static in the pro-file.

    Qt Designer has nothing to do with this problem, as the Designer simply creates ui-files.
    I meant Qt Creator, which should allow you to add that line without having to modify the .pro file directly.

  5. #5
    Join Date
    May 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Problem when linking with own static libraries

    Hi,

    Thanks for your replies. I'm already using QT Creator and CONFIG += staticlib has been automatically added in my .pro files when I created the project.

    Here is an extract from the .pro of my static library :
    Qt Code:
    1. TARGET = MyStaticLibrary
    2. TEMPLATE = lib
    3. CONFIG += staticlib
    To copy to clipboard, switch view to plain text mode 

    I use mingw and g++ that are provided with QTCreator under windows platforms.

Similar Threads

  1. Problem regarding DLL
    By vermarajeev in forum General Programming
    Replies: 3
    Last Post: 5th October 2006, 03:57
  2. static linking issue
    By ashwini in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2006, 12:40
  3. Problem with libmng on static link
    By jlbrd in forum Installation and Deployment
    Replies: 2
    Last Post: 10th May 2006, 22:38
  4. Replies: 4
    Last Post: 20th February 2006, 09:11
  5. Runtime dynamic linking + Qt4 problem
    By _Ramirez_ in forum Qt Programming
    Replies: 5
    Last Post: 11th February 2006, 14:28

Tags for this Thread

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.