两个常见Qt编译错误的解决

作者:朱金灿

来源:http://blog.csdn.net/clever101

 

     如果在电脑上安装了两个Qt版本,在编译一个工程时有可能出现如下的编译错误:

 

ERROR: failed to refresh moc step forqtpropertybrowserutils_p.h

ERROR: failed to refresh moc step forqtpropertybrowserutils_p.h

WARNING: Can't find the Qt version that'sassociated with this project. Defaulting to 4.7.4instead. Please assign a valid Qt version to this project in the Qt projectsettings.

 

解决办法如下:

 

1.      右键选中编译出错的工程,在弹出的右键菜单中选择“Convert project to QMake generated project”,如下图:

2. 在弹出的Project Conversion对话框中选择Yes,具体如下图:

3. 右键选中编译出错的工程,在弹出的右键菜单中选择“Change project’sQt Version”,如下图:

4.在弹出的对话框中设置Qt版本,如下图:

 

在编译一个Qt工程时出现如下的编译错误:

Moc'ing qt1.h...

系统找不到指定的路径。

Project : error PRJ0019: 工具从"Moc'ing qt1.h..."

生成日志保存在“file://d:\Qt\project\qt1\qt1\Debug\BuildLog.htm”

 

问题解决方法:

右键选择t1.h,在属性对话框中修改’自定义生成步骤‘--》'常规'--》’命令行‘中moc.exe的路径,最好修改成$(QTDIR)\bin\moc.exe

 

参考文献:

 

1. 1>Project: error PRJ0019: 某个工具从以下位置返回了错误代码:"Moc'ing thread.h

转载于:https://www.cnblogs.com/lanzhi/p/6470224.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值