WARNING: CLOCK SKEW DETECTED. YOUR BUILD MAY BE INCOMPLETE

本文介绍了一个常见的make编译警告:“WARNING:CLOCKSKEWDETECTED.YOURBUILDMAYBEINCOMPLETE”,解释了该警告产生的原因,即系统时间早于文件最后修改时间。文中提供了解决方案,通过使用date命令来调整服务器时间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

make时遇到这个问题几次了,就记录一下吧。

WARNING: CLOCK SKEW DETECTED. YOUR BUILD MAY BE INCOMPLETE
警告:检测到时钟偏移。 您的构建可能不完整。 (来自谷歌翻译 = =)

问题出现的原因是:系统当前时间早于编译目录中文件的最后修改时间,所以这就很奇怪了,系统中出现了来自未来的文件?所以报这个警告。分析了一下,大概是因为服务器上的时间早于我工作的主机上的时间,所以把文件在本地修改后上传到服务器上会出现此问题。

解决方法:使用date命令查看服务器上当前时间 date -s 修改日期/时间
date -s MM/DD/YYYY .//date -s 03/29/2018
date -s HH:MM:SS //date -s 11:40:30
dae -s “MM/DD/YYYY hh:mm:ss” //date -s “03/29/2018 11:40:30”
还有别的见参考链接= - =

参考:
MAKE编译时“WARNING: CLOCK SKEW DETECTED. YOUR BUILD MAY BE INCOMPLETE.”解决方案

Linux下系统时间设置及date命令使用

在WSL中编译C程序出现编译警告 root@DESKTOP-2QBDJV0:/mnt/d/work/openeuler_env/code/testUsbDongleRFID_pro# ./script/build.sh -- The C compiler identification is GNU 10.3.1 -- The CXX compiler identification is GNU 10.3.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /mnt/d/work/openeuler_env/oecore-x86_64/sysroots/x86_64-peesdk-linux/usr/bin/aarch64-powereuler-linux-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /mnt/d/work/openeuler_env/oecore-x86_64/sysroots/x86_64-peesdk-linux/usr/bin/aarch64-powereuler-linux-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/d/work/openeuler_env/code/testUsbDongleRFID_pro/build make: Warning: File 'Makefile' has modification time 0.31 s in the future make[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.28 s in the future make[2]: Warning: File 'CMakeFiles/run_testUsbDongleRFID.dir/flags.make' has modification time 0.21 s in the future make[2]: warning: Clock skew detected. Your build may be incomplete. make[2]: Warning: File 'CMakeFiles/run_testUsbDongleRFID.dir/flags.make' has modification time 0.17 s in the future [ 50%] Building C object CMakeFiles/run_testUsbDongleRFID.dir/main.c.o /mnt/d/work/openeuler_env/code/testUsbDongleRFID_pro/main.c: In function 'main': /mnt/d/work/openeuler_env/code/testUsbDongleRFID_pro/main.c:121:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result] 121 | write(fd, command, strlen(command)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [100%] Linking C executable run_testUsbDongleRFID make[2]: warning: Clock skew detected. Your build may be incomplete. [100%] Built target run_testUsbDongleRFID make[1]: warning: Clock skew detected. Your build may be incomplete. make: warning: Clock skew detected. Your build may be incomplete.
最新发布
06-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值