qt .prl文件作用
来源:互联网 发布:数据库系统基础 6 pdf 编辑:程序博客网 时间:2024/06/05 08:00
Qt 中.prl文件是为表明依赖库关系而创建的:
Library Dependencies
Often when linking against a library, qmake relies on the underlying platform to know what other libraries this library links against, and lets the platform pull them in. In many cases, however, this is not sufficient. For example, when statically linking a library, no other libraries are linked to, and therefore no dependencies to those libraries are created. However, an application that later links against this library will need to know where to find the symbols that the static library will require. qmake attempts to keep track of the dependencies of a library, where appropriate, if you explicitly enable tracking.
.prl文件来源:
The first step is to enable dependency tracking in the library itself. To do this you must tell qmake to save information about the library:
CONFIG += create_prl
This is only relevant to thelib template, and will be ignored for all others. When this option is enabled, qmake will create a file ending in .prl which will save some meta-information about the library. This metafile is just like an ordinary project file, but only contains internal variable declarations. When installing this library, by specifying it as a target in anINSTALLS declaration, qmake will automatically copy the .prl file to the installation path.
.prl文件使用:
The second step in this process is to enable reading of this meta information in the applications that use the static library:
CONFIG += link_prl
When this is enabled, qmake will process all libraries linked to by the application and find their meta-information. qmake will use this to determine the relevant linking information, specifically adding values to the application project file's list ofDEFINES as well asLIBS. Once qmake has processed this file, it will then look through the newly introduced libraries in the LIBS variable, and find their dependent .prl files, continuing until all libraries have been resolved. At this point, the Makefile is created as usual, and the libraries are linked explicitly against the application.
The .prl files should be created by qmake only, and should not be transferred between operating systems, as they may contain platform-dependent information.
使用.prl文件注意事项:
在使用Qt4.8.6静态库时,发现编译后的静态库lib\***.prl文件中QMAKE_PRL_LIBS项,包含编译时的相对全路径,例如:
QMAKE_PRL_LIBS = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib ws2_32.lib ole32.lib user32.lib advapi32.lib msimg32.lib shell32.lib d:\\Qt_StaticSrc\\qt-everywhere-opensource-src-4.8.6\\lib\\QtCore.lib kernel32.lib uuid.lib
导致qmake生成的makefile.debug中包含有
LIBS =...., d:\\Qt_StaticSrc\\qt-everywhere-opensource-src-4.8.6\\lib\\QtCore.lib ....
编译提示“找不到d:\\Qt_StaticSrc\\qt-everywhere-opensource-src-4.8.6\\lib\\QtCore.lib ”。
解决方法:
打开QT库对应***.prl文件,将
QMAKE_PRL_LIBS = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib ws2_32.lib ole32.lib user32.lib advapi32.lib msimg32.lib shell32.lib d:\\Qt_StaticSrc\\qt-everywhere-opensource-src-4.8.6\\lib\\QtCore.lib kernel32.lib uuid.lib
改为
QMAKE_PRL_LIBS = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib ws2_32.lib ole32.lib user32.lib advapi32.lib msimg32.lib shell32.lib$$[QT_INSTALL_LIBS]\\QtCore.lib kernel32.lib uuid.lib
保存,重新qmake编译即可。
- qt .prl文件作用
- Qt-pro、pri、prf、prl文件学习
- QT中的.pro文件,以及.pri .prj .prl文件说明
- Qt中pro文件以及pri,prf,prl文件
- QT中的.pro文件,以及.pri .prj .prl文件说明
- Qt pro文件详解及pri,prl,prf简介
- Qt介绍2---.pro .pri .prf .prl文件
- QT的qmake使用的几个问题:pro、pri、prf、prl文件 CONFIG的用法
- *.pro、*.pri、*.prf、*.prl文件说明
- Qt moc文件的作用
- 浅谈 qmake 之 pro、pri、prf、prl文件
- 浅谈 qmake 之 pro、pri、prf、prl文件
- *.pro、*.pri、*.prf、*.prl等四种文件
- 浅谈 qmake 之 pro、pri、prf、prl文件
- 浅谈qmake之pro、pri、prf、prl文件
- 浅谈 qmake 之 pro、pri、prf、prl文件
- 浅谈 qmake 之 pro、pri、prf、prl文件
- 浅谈 qmake 之 pro、pri、prf、prl文件
- 使用BMap绘制点、线、面
- iOS常用判断的宏定义:系统版本号,屏幕宽高,设备型号, 自定义NSLog等
- leetcode 289: Game of Life
- 《数学之美》阅读笔记(一)(二)(三)
- Win10配置jdk1.8 亲测有用
- qt .prl文件作用
- python笔记
- Linux/Android——usb触摸屏驱动 - usbtouchscreen (一)
- IDA的string,section查看及代码重定位
- Toolbar随着ScrollView滑动透明度渐变效果实现
- python 4-3 如何调整字符串中文本格式re.sub(p,r'\1/\2',str1)/re.sub('(?P<Name>p),'\g<Name>',str1)
- FastScrollView实现及其setContentSize与setInnerContainerSize理解
- logcat内容备份
- 用 Docker 创建 serverless 应用