当前位置:网站首页>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 ;
边栏推荐
- Interviewer: what are the usage scenarios of ThreadLocal? How to avoid memory leakage?
- Focus on differentiated product design, intelligent technology efficiency improvement and literacy education around new citizen Finance
- Swiftui layout - alignment
- Qtableview in QT sets three methods of paging display [easy to understand]
- Installing MySQL on Linux
- (function(global,factory){
- 树莓派基础 | 总结记录树莓派学习过程中的一些操作
- How to use the C language library function getchar ()
- pix2pix
- How to effectively conduct the review meeting (Part 1)?
猜你喜欢

Raspberry pie foundation | summarize and record some operations in the learning process of raspberry pie

9、 Uni popup usage popup effect at the bottom of the drop-down box

Redis-Redis在Jedis中的使用

linux安装redis

Hcip day 12

Installing redis in Linux
C # 7 methods to obtain the current path

一些企业数据平台建设的思考

2022年熔化焊接与热切割考题及在线模拟考试
![[ecmascript6] async and await](/img/3c/c7de42ad572dc95b188243c02dd228.png)
[ecmascript6] async and await
随机推荐
[leetcode] 1331. Array sequence number conversion
Redis persistence
Raspberry pie foundation | summarize and record some operations in the learning process of raspberry pie
Create a table under swiftui with table
Qtableview in QT sets three methods of paging display [easy to understand]
为 @CloudStorage 添加了类 @Published 的能力
2022年熔化焊接与热切割考题及在线模拟考试
2022 melting welding and thermal cutting examination questions and online simulation examination
Third class exercise
SwiftUI 布局 —— 尺寸( 下 )
How long can we "eat" the dividends of domestic databases?
数字化转型安全问题频发,山石网科助力数字政府建设
I am using a blog creation tool
2022年熔化焊接与热切割考题及在线模拟考试
ZABBIX distributed
使用Weka与Excel进行简单的数据分析
On July 29, apachecon | apachepulsar's exploration and practice in vivo will be broadcast soon
Node file operation
如何在 Core Data 中进行批量操作
2022年安全员-A证操作证考试题库模拟考试平台操作