PDA

View Full Version : Using static lib compiled in Qt 5 in a program compiled in Qt 4.8.0



qt_developer
11th July 2014, 14:26
Hi,

I want to use a static lib compiled in Qt 5 in a program compiled in Qt 4.8.0.

Is it possible?

Regards.

anda_skoa
11th July 2014, 15:46
No

Cheers,
_

d_stranz
11th July 2014, 18:48
I want to use a static lib compiled in Qt 5 in a program compiled in Qt 4.8.0.


How would you even do that? A static lib is linked in at the time the executable is built, so you would have to at least have object files for the app, and if you had those, you'd probably also have the sources so you could recompile the whole thing against Qt 5.

qt_developer
11th July 2014, 19:53
I need use QWebView of Qt 5 into Qt 4.8.0 program. Would it be possible if I compile a widget based in Qt 5 in a dynamic library instead?

stampede
11th July 2014, 19:56
Why not just use Qt 5 ?

d_stranz
12th July 2014, 05:07
I need use QWebView of Qt 5 into Qt 4.8.0 program.

This makes no sense at all. If your Qt 4.8 program doesn't know about QWebView, and you don't port or recompile it, how is it going to know about QWebView whether it is in a static or dynamic library? It's like saying you are going to lay your wallet next to a pile of money, and somehow that money is going to magically show up inside your wallet. If you don't open your wallet and put the money inside, it isn't going to get there by itself.

If you can't rebuild your Qt 4.8 program, you can't change anything about the way it works. If you want to use Qt 5 features in a program that was written using Qt 4.8 release, you have to port the source code for the program to be compatible with Qt 5.