当前位置:网站首页>QT编译出来的exe以管理员权限启动
QT编译出来的exe以管理员权限启动
2022-07-27 00:16:00 【无聊的阿乐】
1、编译QT时遇到问题:

2、解决方法
MinGW下加权限
这种方法需要先创建.manifest文件,如app.exe.manifest,文件内容如下:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='requireAdministrator' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
然后再创建一个.rc文件,如app.rc,这两个文件都需要放在Pro文件同级目录下,rc文件内容如下:
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "app.exe.manifest"
最后在Pro文件中再附加如下代码:
RC_FILE = app.rc
重新编译运行即可解决
边栏推荐
猜你喜欢

How to do the system security test? Let's talk about it in detail

红宝书第四版的一个错误?

Okaleido tiger is about to log in to binance NFT in the second round, which has aroused heated discussion in the community

【Redis】五种常用的数据类型

Cuteone: a onedrive multi network disk mounting program / with member / synchronization and other functions

Pyqt5 use pyqtgraph to draw dynamic scatter chart

面试突击68:为什么 TCP 需要 3 次握手?

Favicon网页收藏图标在线制作PHP网站源码/ICO图片在线生成/支持多种图片格式转换

CuteOne:一款OneDrive多网盘挂载程序/带会员/同步等功能

Okaleido Tiger 7.27日登录Binance NFT,首轮已获不俗成绩
随机推荐
哪家券商开户买REITs基金比较安全?
pyqt5使用pyqtgraph画动态散点图
Knowledge points of test questions related to software testing
解决小程序报错getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json
B-树的应用以及添加和删除操作
Arduino UNO +74hc164 water lamp example
快速排序(Quick sort)
八皇后编程实现
setTimeout第一个参数应该注意的地方
平成千字文(へいせいせんじもん) (平成12年9月10日 石渡 明 作) 宇宙広遠 銀河永久 日月運行 不乱無休 地球公転 季節変移 黄道星座 太陽年周 故郷群島 南熱北冷 海洋温暖 気候順良 青空飛雲 諸野深緑 湖泉静息 谷川清流 春桜一面 新芽
Okaleido tiger logged into binance NFT on July 27, and has achieved good results in the first round
Okaleido tiger is about to log in to binance NFT in the second round, which has aroused heated discussion in the community
Lua函数之非全局函数
基于GoLang实现API短信网关
Heisei thousand words (Heisei, September 10, 2012) (Shidu Mingzuo) the universe is far away, the Milky way is permanent, the sun and moon are running disorderly, the earth is open, the seasons shift,
Leetcode- > binary search clock in
Debezium series: the binlog file cannot be recovered after the record is hung from the library server, and the task is switched to the main library to ensure that the data is not lost
Kubeadmin到底做了什么?
人们为什么热衷于给事物排序
Ansible series: do not collect host information gather_ facts: False