内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

應(yīng)用程序如何鏈接靜態(tài)QTPlugin庫

  1. 錯誤描述
    靜態(tài)編譯了QT庫后,我的應(yīng)用程序要鏈接到這些靜態(tài)庫。但是出現(xiàn)了如圖所示錯誤:
    應(yīng)用程序如何鏈接靜態(tài)QT Plugin庫
    運行時錯誤錯誤提示:
    This application failed to start because it could not find or load the Qt platform plugin "windows" in "".

    網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)建站!專注于網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、重慶小程序開發(fā)、集團企業(yè)網(wǎng)站建設(shè)等服務(wù)項目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了青州免費建站歡迎大家使用!

  2. 解決過程
    Google關(guān)鍵字“Qt staticPlugins”, to get the first result as:

How to Create Qt Plugins

To link plugins statically, you need to add the required plugins to your build using QTPLUGIN.

In the .pro file for your application, you need the following entry:

QTPLUGIN += qjpeg \
qgif \
qkrcodecs
qmake automatically adds the plugins to QTPLUGIN that are typically needed by the Qt modules used (see QT), while more specialized plugins need to be added manually. The default list of automatically added plugins can be overridden per type. For example, to link the minimal plugin instead of the default Qt platform adaptation plugin, use:

QTPLUGIN.platforms = qminimal
If you want neither the default, nor the minimal QPA plugin to be linked automatically, use:

QTPLUGIN.platforms = -
The defaults are tuned towards an optimal out-of-the-box experience, but may unnecessarily bloat the application. It is recommended to inspect the linker command line built by qmake and eliminate unnecessary plugins.

Details of Linking Static Plugins
To cause static plugins actually being linked and instantiated, Q_IMPORT_PLUGIN() macros are also needed in application code, but those are automatically generated by qmake and added to your application project.

If you do not want all plugins added to QTPLUGIN to be automatically linked, remove import_plugins from the CONFIG variable:

CONFIG -= import_plugins
Creating Static Plugins
It is also possible to create your own static plugins, by following these steps:

Add CONFIG += static to your plugin's .pro file.
Use the Q_IMPORT_PLUGIN() macro in your application.
Use the Q_INIT_RESOURCE() macro in your application if the plugin ships qrc files.
Link your application with your plugin library using LIBS in the .pro file.
See the Plug & Paint example and the associated Basic Tools plugin for details on how to do this.

Note: If you are not using qmake to build your plugin you need to make sure that the QT_STATICPLUGIN preprocessor macro is defined.

3. 解決方法
上述方法均可以使用。我的項目是VC項目,最直接的辦法是在main 文件中全局位置調(diào)用宏

// link to static QT lib, following lines to import platform static lib's header
#include <QtPlugin>
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)

新聞標(biāo)題:應(yīng)用程序如何鏈接靜態(tài)QTPlugin庫
分享鏈接:http://www.rwnh.cn/article2/ipcgoc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號、ChatGPT網(wǎng)站排名、營銷型網(wǎng)站建設(shè)響應(yīng)式網(wǎng)站、網(wǎng)站營銷

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計
淄博市| 南涧| 策勒县| 怀远县| 德令哈市| 根河市| 彰武县| 射阳县| 安达市| 东海县| 阿尔山市| 麻城市| 隆昌县| 登封市| 梅河口市| 金昌市| 铁力市| 湄潭县| 崇左市| 锡林浩特市| 海丰县| 鄂尔多斯市| 信阳市| 秦安县| 田阳县| 祁东县| 安福县| 金川县| 山阳县| 华坪县| 民权县| 镇原县| 吉木乃县| 巨鹿县| 昆山市| 赤峰市| 南宁市| 那曲县| 鄯善县| 双桥区| 禹城市|