当前位置:网站首页>[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
边栏推荐
- Analysis and solution of anr problems
- 性能测试常见面试题
- 【微信小程序開發】樣式匯總
- 如果在小券商办理网上开户安全吗?我的资金会不会不安全?
- Lavaweb [first understanding the solution of subsequent problems]
- ipmitool下载地址和编译安装时可能出现的问题
- Youmeng (a good helper for real-time monitoring of software exceptions: crash) access tutorial (the easiest tutorial for Xiaobai with some foundation)
- Mnasnet learning notes
- Restcloud ETl数据通过时间戳实现增量数据同步
- Servlet [first introduction]
猜你喜欢
最新接口自动化面试题
Complete training and verification of a neural network based on pytorch
Huawei operator level router configuration example | BGP VPLS configuration example
记一次服务部署失败问题排查
Detailed data governance knowledge system
servlet【初识】
联想X86服务器重启管理控制器(XClarity Controller)或TSM的方法
[applet project development -- Jingdong Mall] user defined search component of uni app (Part 1)
STM32 - DS18B20 temperature sampling of first-line protocol
Evaluation of the entry-level models of 5 mainstream smart speakers: apple, Xiaomi, Huawei, tmall, Xiaodu, who is better?
随机推荐
单片机 MCU 固件打包脚本软件
Use ipmitool to configure BMC network and user information of X86 server
Proxy support and SNI routing of pulsar
kubernetes资源对象介绍及常用命令(二)
LeetCode_ Stack_ Difficulties_ 227. basic calculator (excluding multiplication and division)
【小程序项目开发 -- 京东商城】uni-app 商品分类页面(下)
RestCloud ETL实践之无标识位实现增量数据同步
Sampling Area Lights
鼠标悬停效果六
【微信小程序開發】樣式匯總
Lenovo x86 server restart management controller (xclarity controller) or TSM method
Xception学习笔记
【微信小程序开发】样式汇总
JS to find duplicate elements in two arrays
Network address translation (NAT) technology
【小程序项目开发--京东商城】uni-app之自定义搜索组件(上)
js中的原型和原型链
Catch 222222
Mouse over effect I
Saving images of different depths in opencv