当前位置:网站首页>[QT] add knowledge supplement of third-party database
[QT] add knowledge supplement of third-party database
2022-07-01 02:55:00 【I don't know what I'm doing every day】
Write it at the front
This article will focus on QT The process and principle of adding a third-party library is a knowledge supplement , Including static library and dynamic library 、MinGW and MSVC、make and makeinstall、debug and release、 Environmental variables, etc .(C++ In the same way )
1、 library
1.1、 Static library
Windows :.lib
Linux\Mac:.a
The static library will be directly copied into the target program when compiling .
( After the program is packaged , Put it on a computer without an environment , It can also operate normally )
2.2、 Dynamic library
Windows :.dll
Linux:.so
Mac: dylib
Dynamic libraries are not copied to the target program at compile time , Will only be called at runtime .
( After the program is packaged , Put it on a computer without an environment , May not function properly ; The corresponding dll Dynamic libraries are packaged together for normal operation )
2、 compiler
2.1、MSVC
MSVC Microsoft 's VC compiler , It is mainly used for windows Lower development .
( Use msvc When importing a third-party library , Library files are usually .lib)
2.2 MinGW
MinGW Means Minimalist GNU on Windows Abbreviation . It's a freely available and freely distributed Windows Specific header files and usage GNU Toolset import collection , Allow you to stay GNU/Linux and Windows Platform generates local Windows Programs without the need for third-party runtime libraries .
( Use mingw When importing a third-party library , Library files are usually .a)
MinGW And MSVC The difference between
3、make and make install
3.1、make
make It's for compiling , It is from Makefile Read instructions in , Then compile .
If you use static libraries , It only needs make that will do , Generate .lib perhaps .a.
3.2、make insatll
make install It's for installation , It also comes from Makefile Read instructions in , Install to specified location .
If you use dynamic libraries , need make insatll, Generate .dll perhaps .so. In general, you need to configure environment variables before importing a dynamic library .
4、 Configure environment variables
Configuration environment variables are generally executable files .exe The catalog of .
If you configure a third-party library 、 Is the directory for configuring the dynamic library , Generally in make insatll Later generated bin Directory , It contains dll or .exe file
5、 stay windows Call the static library
( Static libraries only need to be compiled , no need make insatll)
Usually use first cmake Generate makefile, perhaps sln
5.1 MingGw
use mingw32-make compile
Get the compiled .a file
Configure... In code .a Files and header files (include)
5.2 MSVC
open camke Generated sln( use vs2019)
choice Debug perhaps Release,x86\x64
choice ALL_BUILD, Right click , To regenerate the
Get output .lib file , distinguish debug and release
Configure... In code .lib Files and header files (include)
6、 stay windows Call dynamic library
( Dynamic library needs make insatll)
Usually use first cmake Generate makefile, perhaps sln
5.1 MingGw
use mingw32-make compile
And then again mingw32-make install
In the output directory, there is usually a bin Catalog , There are dll or exe
Put this bin Add the path of the directory to the environment variable
Get the compiled .a file ( Generally in lib Under the table of contents )
Configure... In code .a Files and header files (include)
5.2 MSVC
To be added …
7、 stay VS2019 Add a third-party library
Visual Studio Configure the third party C/C++ Method of library
Generally, dynamic libraries are configured like this 

The static library is configured like this 


边栏推荐
- Complete training and verification of a neural network based on pytorch
- PHP batch Excel to word
- MCU firmware packaging Script Software
- Poj-3486-computers[dynamic planning]
- Detailed explanation of pointer array and array pointer (comprehensive knowledge points)
- Mnasnet learning notes
- VMware vSphere 6.7虚拟化云管理之12、VCSA6.7更新vCenter Server许可
- Restcloud ETl数据通过时间戳实现增量数据同步
- Thread Detach
- Dart training and sphygmomanometer inflation pump power control DPC
猜你喜欢

Optimal Transport系列1

Prototype and prototype chain in JS

Applet custom top navigation bar, uni app wechat applet custom top navigation bar

UE4 rendering pipeline learning notes

Sampling Area Lights

咱就是说 随便整几千个表情包为我所用一下

【机器学习】向量化计算 -- 机器学习路上必经路

Huawei operator level router configuration example | BGP VPLS and LDP VPLS interworking example

Pulsar geo replication/ disaster recovery / regional replication
性能测试常见面试题
随机推荐
Cloud native annual technology inventory is released! Ride the wind and waves at the right time
Dell server restart Idrac method
[small program project development -- Jingdong Mall] the home page commodity floor of uni app
大橙子疯博客搬家通知
kubernetes资源对象介绍及常用命令(二)
Mouse over effect I
Od modify DLL and exe pop-up contents [OllyDbg]
Applet custom top navigation bar, uni app wechat applet custom top navigation bar
【微信小程序开发】样式汇总
Mnasnet learning notes
import tensorflow. contrib. Slim as slim error
【小程序项目开发-- 京东商城】uni-app之分类导航区域
Lavaweb [first understanding the solution of subsequent problems]
How do I hide div on Google maps- How to float a div over Google Maps?
Proxy support and SNI routing of pulsar
Optimal Transport系列1
SAP ALV summary is inconsistent with exported excel summary data
Youmeng (a good helper for real-time monitoring of software exceptions: crash) access tutorial (the easiest tutorial for Xiaobai with some foundation)
The operation efficiency of the park is improved, and the application platform management of applet container technology is accelerated
AI edge computing platform - beaglebone AI 64 introduction