简体   繁体   中英

Loading Qt libs(different versions) inside an application

We have our application developed in Qt 5.4 which is shipped as an SDK (dylib) for integration with other applications. All the dependent libs are shipped along with the SDK(Qt 5.4.x binaries). However we bumped into an issue when the customer tried to integrate our SDK in his application. That application is making use of a component which has a Qt 5.3.x dependency. Our SDK has not worked with the application. The issue is due to the fact the "libqcocoa" in platforms is shared, which is leading to a crash.

Can an application be able to load two different Qt binaries(with/without namespace) ? If yes, how this can safely taken care ? (application is in Mac)

I also need to address the point that, the components which are using different Qt versions can be updated independently. What are the best practices generally followed ? Please suggest.

Your use of Qt is usually an implementation detail. Hide it by using private frameworks or linking Qt statically.

Alternatively, if you need to interoperate with the user's Qt, add a small open-source interface that forwards relevant Qt APIs to your code. You'll be surprised at how little Qt most code uses. The interface is likely going to be a couple thousand lines at most and you can machine-generate it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM