当前位置:网站首页>[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 


边栏推荐
- 使用ipmitool配置X86服务器的BMC网络和用户信息
- 联想X86服务器重启管理控制器(XClarity Controller)或TSM的方法
- robots. Txt restrict search engine inclusion
- Gartner研究:在中国,混合云的采用已成为主流趋势
- 大橙子疯博客搬家通知
- Restcloud ETl数据通过时间戳实现增量数据同步
- Is it safe to open an account online in a small securities firm? Will my money be unsafe?
- Nacos configuration center tutorial
- Scale SVG to container without mask / crop
- 【小程序项目开发-- 京东商城】uni-app之首页商品楼层
猜你喜欢

UE4渲染管线学习笔记

【小程序项目开发--京东商城】uni-app之自定义搜索组件(上)

在unity中使用jieba分词的方法

xxl-job使用指南

Voici le programme de formation des talents de SHARE Creators!

彻底解决Lost connection to MySQL server at ‘reading initial communication packet

Visual effects, picture to cartoon function

Introduction to kubernetes resource objects and common commands (II)

Pychart software deployment gray unable to point
![[applet project development -- JD mall] uni app commodity classification page (Part 2)](/img/f3/752f41f5b5cc16c8a71498ea9cabb5.png)
[applet project development -- JD mall] uni app commodity classification page (Part 2)
随机推荐
【Qt】添加第三方库的知识补充
PTA 1017
Why are strings immutable in many programming languages? [repeated] - why are strings immutable in many programming languages? [duplicate]
基于OPENCV和图像减法的PCB缺陷检测
If I am in Beijing, where is a better place to open an account? In addition, is it safe to open a mobile account?
SAP ALV summary is inconsistent with exported excel summary data
Complete training and verification of a neural network based on pytorch
lavaweb【初识后续问题的解决】
Huawei operator level router configuration example | configuration static VPLS example
Restcloud ETL data realizes incremental data synchronization through timestamp
RestCloud ETL实践之无标识位实现增量数据同步
7_OpenResty安装
Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and
Optimal transport Series 1
股票开账户如何优惠开户?还有,在线开户安全么?
彻底解决Lost connection to MySQL server at ‘reading initial communication packet
Huawei operator level router configuration example | BGP VPLS configuration example
[small program project development -- Jingdong Mall] the home page commodity floor of uni app
AI edge computing platform - beaglebone AI 64 introduction
【EXSI】主机间传输文件