环境:Ubuntu 18.04, QT 5.14
问题描述:从一台电脑移植项目文件到另一台电脑后,重新编译显示:
file“xxxxx”has modification times xxxxx s in the future
解决方法:
1.先修改系统时间
sudo date -s 2021-10-25
sudo date -s 21:05:50
sudo hwclock --systohc
项目文件可正常编译
2.还原系统时间
ntpdate cn.pool.ntp.org
sudo hwclock --systohc
3.修改项目文件时间戳
find . -type f | xargs -n 5 touch
find /projectDir -type f -exec touch {} +
此时可在当前时间下重新编译QT项目
本文介绍了解决QT项目中因文件时间戳在未来而导致的编译错误的方法,包括调整系统时间、使用ntp同步时间及更新文件的时间戳。
3万+

被折叠的 条评论
为什么被折叠?



