tags:

views:

290

answers:

1

I am building an application on Windows with Visual Studio 2003.

My application is linking to 3rd party lib (Qt). The lib is called qtcore4.lib and the dll qtcore4.dll.

My application is a plugin to another Qt based application which uses different versions of the same qtcore4.dll.

Unfortunately, I can not use the same version of Qt as the host application so I am thinking if it would work if I would rename the lib and DLL of my version of Qt, such as:

qtcore4_my.lib
qtcore4_my.dll

I guess qtcore4.lib refers to the qtcore4.dll inside. So I am not sure this would work at all.

+3  A: 

You should take care of using two different versions of the same library in the same application.

If the plugin interface uses classes from QT, then you should expect pottential nasty problems (like crashes).

The most simple way of doing it is to recompile qt and configure the building process to produce the dll and lib files with other names.

Cătălin Pitiș
I deleted my answer - this one is better - re: rebuilding qt. It is still a huge minefield though of potential problems...
Tim
I agree with you :). And a lengthy task as well.
Cătălin Pitiș
I am giving this one a try. Lets see what happens at runtime :(
Paul
Rebuilding qt with different dll names, seems to be working fine.
Paul
Right, but as soon as you load the plugin into the application, I would expect horrible symbol clashes and other problems which can cause catastrophic crashes.
ephemient
This is asking for problem. FYI, there is a reason why a Qt 4 application can load a plugin which dynamically loads a Qt 3 (and this indeed happen, in particular via a mix of styles between Qt and Gtk+).
Ariya Hidayat
I must have missed this, but how do you 'configure the building process' to generate alternative names for the libraries? Thanks.
swongu