当前位置:网站首页>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 ;
边栏推荐
- C# 获取当前路径7种方法
- Second class exercise
- Log management platform of infrastructure and nail & email alarm notification
- Hand in hand from 0 to a "Nuggets special attention" Google plug-in, 5000 words detailed vue3 responsive principle, the advantages, disadvantages and choices of several cache read-write schemes, flyin
- SwiftUI 的动画机制
- 复制excel行到指定行
- 国产数据库的红利还能“吃”多久?
- 分集技术简略
- 2022 safety officer-a certificate operation certificate examination question bank simulated examination platform operation
- Create a table under swiftui with table
猜你喜欢
![[ecmascript6] other new interface features](/img/da/377f93d83b6722bf250d270e4eea28.png)
[ecmascript6] other new interface features

多商户商城系统功能拆解17讲-平台端订单列表

Read the introduction tutorial of rainbow

Redis-配置文件讲解

Langjing Technology (Trax China) "robot +ai" opens the era of Chinese retail meta universe

企鹅一面:为什么不建议使用SELECT * ?

Redis redis use in jedis

7月29日 ApacheCon|Apache Pulsar 在 vivo 的探索与实践 即将开播

Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it

树莓派基础 | 总结记录树莓派学习过程中的一些操作
随机推荐
Swiftui layout - size (top)
使用Weka与Excel进行简单的数据分析
UI开发中所遇到的各种坑
JS instantiation method
SwiftUI 布局 —— 尺寸( 下 )
Afnetworking crash course
如何在 Core Data 中进行批量操作
[thread safety] what risks may multithreading bring?
(function(global,factory){
Some problems encountered in the development of Excel VBA, solutions, and continuous updates
Force deduction solution summary 1331 array sequence number conversion
FormData对象的使用, var formdata=new FormData()
&0xffffffff(0x08)
2022 high altitude installation, maintenance, removal of examination question bank and online simulated examination
[ecmascript6] async and await
Various pitfalls encountered in UI development
(function(global,factory){
[线程安全问题] 多线程到底可能会带来哪些风险?
Simple data analysis using Weka and excel
2022 low voltage electrician examination questions and answers