当前位置:网站首页>QT environment cannot run error set
QT environment cannot run error set
2022-07-28 14:51:00 【Love the west wind】
One 、 The lack of qt platform Dependency Library ;
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Less platform dll library , Such as windows platform
take similar Your path D:\ProgramData\Qt\5.12.4\msvc2017_64\plugins\platforms
copy to Running directory ; In fact, it uses qwindows.dll or qwindowsd.dll
Two 、 The lack of qt sqldrive Dependency Library
WARNING: QSqlDatabase: QSQLITE driver not loaded
Less sqldrive
take similar Your path D:\ProgramData\Qt\5.12.4\msvc2017_64\plugins\sqldrivers
copy to Running directory ;
The above two can also be passed cmake Realization
Specify a set of custom plug-ins to import ( Be careful : This macro is only from static Qt Build import plug-ins . On the shared version , Invalid .)
qt5_import_plugins(target
[INCLUDE plugin ...]
[EXCLUDE plugin ...]
[INCLUDE_BY_TYPE plugin_type plugin ...]
[EXCLUDE_BY_TYPE plugin_type]) Specify a set of custom plug-ins to import . Optional parameters :INCLUDE,EXCLUDE,INCLUDE_BY_TYPE, and EXCLUDE_BY_TYPE, Multiple use .
this CMake Command in Qt 5.14 Introduction in .
INCLUDE - Can be used to specify the list of plug-ins to import .
EXCLUDE - Can be used to specify the list of plug-ins to exclude .
INCLUDE_BY_TYPE - Can be used to override the list of plug-ins to import for a specific plug-in type .
EXCLUDE_BY_TYPE- Can be used to specify the plug-in type to exclude ; Then this type of plug-in will not be imported .
Qt Provide plug-in types , for example imageformats,platforms, and sqldrivers.
If qt5_import_plugins() Not invoked , Then the target will automatically link to a set of default plug-ins , For each Qt modular . For more information , Please see the target_link_libraries.
Each plug-in comes with a C ++ Stub file , This file will automatically initialize the plug-in . therefore , Any target linked to the plug-in will put this C ++ Add file to it SOURCES.
Be careful : This macro is only from static Qt Build import plug-ins . On the shared version , Invalid .
Example
add_executable(myapp main.cpp)
target_link_libraries(myapp Qt5::Gui Qt5::Sql)
qt5_import_plugins(myapp
INCLUDE Qt5::QCocoaIntegrationPlugin
EXCLUDE Qt5::QMinimalIntegrationPlugin
INCLUDE_BY_TYPE imageformats Qt5::QGifPlugin Qt5::QJpegPlugin
EXCLUDE_BY_TYPE sqldrivers
)
In the code snippet above , Execution procedure myapp The following happened :
take Qt5::QCocoaIntegrationPlugin Import to myapp in .
The Qt5::QMinimalIntegrationPlugin Plug ins are not automatically imported into myapp in .
The default plug-in list imageformats Covered to include only Qt5 :: QGifPlugin and Qt5 :: QJpegPlugin.
all sqldrivers Plug ins will not be automatically imported .
3、 ... and 、windows platform , The lack of VC Runtime
You can download this installation
VisualC++AIOv2019.05.21-C++ Document resources -CSDN download
Four 、 could not be loaded: Cannot load library Prompt missing dependent Library
could not be loaded: Cannot load library If you compile the library yourself, it cannot be loaded , Less dependence , It is still necessary to check ;
For example, it indicates that the file name is missing , You can find the corresponding dependent library according to the directory and copy it ;
windows The platform can be accessed through log and depends.exe Check it out ;
linux The platform can check dependencies through the command line
1. View dependent Libraries : objdump -x xxx.so | grep NEEDED
2. View the libraries that the executable depends on : objdump -x Executable name | grep NEEDED
3. View missing Libraries : ldd xxx.so
There are two solutions to the lack of inventory
1, Add to environment variables , If the folder is suitable for this method ;
2, Copy directly to the current directory ;
Another situation is that the directory of the current library is wrong , Move to the appropriate folder , This folder contains the libraries it depends on ,
But you cannot copy the library it depends on , Otherwise, there will be two , There will be problems ;
Summary
In short, specific issues , Specific analysis is also needed , Constantly encounter problems , Can't solve the problem , Growing up ;
边栏推荐
- 2022年熔化焊接与热切割考题及在线模拟考试
- [ecmascript6] other new interface features
- Another way of understanding the essence of Hamming code
- Added the ability of class @published for @cloudstorage
- Qt中QTableView设置分页显示的三种方法[通俗易懂]
- Product Manager
- C # read INI file and key value pair operation
- ZABBIX distributed
- ScottPlot入门教程:获取和显示鼠标处的数值
- Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it
猜你喜欢

Simple data analysis using Weka and excel

Store and guarantee rancher data based on Minio objects

Hcip day 10

Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it
C # 7 methods to obtain the current path
Excel VBA 开发过程中遇到的一些问题,解决方案,持续更新

Bulk Rename Utility

Installing MySQL on Linux

58子站安居,经纪人营销管理平台登录接口加密逆向

ScottPlot入门教程:获取和显示鼠标处的数值
随机推荐
OKR and grad
The 35 required questions in MySQL interview are illustrated, which is too easy to understand
Force deduction solution summary 1331 array sequence number conversion
Animation mechanism of swiftui
Another way of understanding the essence of Hamming code
Node文件操作
使用Weka与Excel进行简单的数据分析
Brief introduction and use of mqtt entry level
[线程安全问题] 多线程到底可能会带来哪些风险?
爆肝整理JVM十大模块知识点总结,不信你还不懂
Qtableview in QT sets three methods of paging display [easy to understand]
58子站安居,经纪人营销管理平台登录接口加密逆向
力扣解法汇总1331-数组序号转换
Redis-Redis在Jedis中的使用
为 @CloudStorage 添加了类 @Published 的能力
Factory mode and constructor mode
ssh服务
&0xffffffff(0x08)
Thoughts on the construction of some enterprise data platforms
C# 获取当前路径7种方法