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


边栏推荐
- Mouse over effect I
- Is it safe to open an account online in a small securities firm? Will my money be unsafe?
- Is it safe to open a stock account? Shanghai stock account opening procedures.
- AI edge computing platform - beaglebone AI 64 introduction
- Complete training and verification of a neural network based on pytorch
- lavaweb【初识后续问题的解决】
- 园区运营效率提升,小程序容器技术加速应用平台化管理
- 产业互联网中,「小」程序有「大」作为
- 记一次服务部署失败问题排查
- 鼠标悬停效果七
猜你喜欢

Restcloud ETL WebService data synchronization to local

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

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

在unity中使用jieba分词的方法

Huawei operator level router configuration example | configuration static VPLS example

Xception学习笔记

Nacos configuration center tutorial

Densenet network paper learning notes

Visual effects, picture to cartoon function

AI edge computing platform - beaglebone AI 64 introduction
随机推荐
鼠标悬停效果五
Share Creators萌芽人才培養計劃來了!
How do I hide div on Google maps- How to float a div over Google Maps?
Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and
Introduction to kubernetes resource objects and common commands (II)
Use ipmitool to configure BMC network and user information of X86 server
Analysis and solution of anr problems
Mouse over effect V
[applet project development -- Jingdong Mall] classified navigation area of uni app
In the industrial Internet, "small" programs have "big" effects
鼠标悬停效果十
Big orange crazy blog move notice
Résumé des styles de développement d'applets Wechat
Gartner research: in China, the adoption of hybrid cloud has become the mainstream trend
【Qt】添加第三方库的知识补充
LeetCode_栈_困难_227.基本计算器(不含乘除)
Share Creators萌芽人才培养计划来了!
Borrowing constructor inheritance and composite inheritance
如果在小券商办理网上开户安全吗?我的资金会不会不安全?
[small program project development -- Jingdong Mall] the home page commodity floor of uni app