Results 1 to 4 of 4

Thread: Multiple Qt in same application?

  1. #1
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Multiple Qt in same application?

    I'm using on windows a thirdparty .dll that needs QtGui4.dll of version 4.something and I can't change that application, however in my application I use QtGui4.dll version 4.7.4. of course loading those two dlls together is problematic. I can't put them in the same dir, and if I change the system path for dllload it will be the same path for my application and thirdparty dll.

    I have two possible solutions I'm looking at
    1: Statically link to Qt (I really prefer not using this solution)
    2: Somehow build Qt with adding suffix/prefix to libraries build so I'll get something like : QtGui4v474.dll etc. This is actually done automatically in wxWidgets and I was hoping there is something like that in Qt.

    If there are other options I'll be happy to hear

    Thank you

  2. #2
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Re: Multiple Qt in same application?

    http://www.qtcentre.org/threads/2238...nt-QT-versions
    Did you try having the thirdparty DLL use the 4.7.4 binary? Does it break? As long as Trolltech doesn't think it's necessary to use different file names, I would assume that the 4.7 binary is compatible with code written for an earlier 4.x release.

  3. #3
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Multiple Qt in same application?

    The problem is not with the thirdparty library but more general.
    I might have an older version of Qt somewhere installed in the dll load path for example Qt4.0 but my application will need 4.7 and of course it will find the older version, load it and my application will not work. This is a forward compatibility problem. Best solution is to have Qt dlls with the version number in the name. don't know why it was not done in the first place or a way to add prefix/suffix to the output libraries was not provided

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Multiple Qt in same application?

    It is possible to build Qt with a suffix, see configure -help for details. You'll also need to put your Qt in a namespace so that there are no symbol clashes with the other Qt library (which will work without a namespace).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QT Application gives Multiple Definition Link Error
    By behlkush in forum Qt Programming
    Replies: 4
    Last Post: 10th March 2015, 04:52
  2. Multiple timers in single Application
    By Qt Coder in forum Qt Programming
    Replies: 47
    Last Post: 5th October 2012, 14:23
  3. How to prevent multiple executables from application
    By jshafferman in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2011, 20:44
  4. Replies: 2
    Last Post: 21st September 2010, 10:17
  5. Multiple Qt Application
    By girishgowda in forum Qt Programming
    Replies: 4
    Last Post: 11th May 2010, 11:03

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.