[英]Qt Creator error endless loop
When I try to create a project which was developed by someone working in a different country and timezone I keep getting the following error in my console.当我尝试创建一个由在不同国家和时区工作的人开发的项目时,我的控制台中不断出现以下错误。 He had mentioned this problem is because of the Data/Time being different from his computer to mine.
他提到这个问题是因为他的电脑和我的电脑的数据/时间不同。 I'm not sure if that is true, if it is, there has to be a solution for that without having to change my computer time to match his.
我不确定这是否属实,如果是,则必须有解决方案,而不必更改我的计算机时间以匹配他的时间。 I'm not sure what else to post that would be helpful in trouble shooting this, if there is just let me know and I'll update.
我不知道还有什么可以帮助解决这个问题的帖子,如果有的话让我知道,我会更新。 I'm a bit new to C++/Qt Creator.
我对 C++/Qt Creator 有点陌生。 Why is this happening.
为什么会发生这种情况。 It seems to never finish, it just endlessly prints this to the console.
它似乎永远不会完成,它只是无休止地将其打印到控制台。
Compile Output Console编译输出控制台
Running steps for project Nexus...
Configuration unchanged, skipping qmake step.
Starting: "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe"
C:\Qt\5.5\mingw492_32\bin\qmake.exe -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" -o Makefile ..\Nexus\Nexus.pro
C:\Qt\5.5\mingw492_32\bin\qmake.exe -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" -o Makefile ..\Nexus\Nexus.pro
C:\Qt\5.5\mingw492_32\bin\qmake.exe -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" -o Makefile ..\Nexus\Nexus.pro
C:\Qt\5.5\mingw492_32\bin\qmake.exe -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" -o Makefile ..\Nexus\Nexus.pro
General Message Output Console通用消息输出控制台
Warnings while parsing QML type information of C:/Qt/5.5/mingw492_32/qml:
<dump of C:\Qt\5.5\mingw492_32\qml>:1:24: Reading only version 1.1 parts.
<dump of C:\Qt\5.5\mingw492_32\qml>:10:5: Expected only Component and ModuleApi object definitions.
Pro file轮廓
#-------------------------------------------------
#
# Project created by QtCreator 2016-02-29T21:37:32
#
#-------------------------------------------------
QT += core gui xml
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
include(core/core.pri)
include(node/node.pri)
include(librarybox/librarybox.pri)
include(blockeditor/blockeditor.pri)
include(propertyeditor/propertyeditor.pri)
include(lib/lib.pri)
TARGET = Nexus
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui \
virtualnamepropertyitem.ui
RESOURCES += \
nexus_resources.qrc
RC_FILE = nexus.rc
This can happen if your .pro
file (or any other file) has a timestamp from the future.如果您的
.pro
文件(或任何其他文件)具有未来的时间戳,就会发生这种情况。 The Makefile
generated by qmake
contains a rule that will generated the Makefile
anew when its older than the .pro
file.在
Makefile
所产生qmake
包含将产生一个规则Makefile
重新当它比老.pro
文件。 Since the new Makefile
is still older than its counterpart from the future, this will go on till you actually reach the correct time.由于新的
Makefile
仍然比未来的对应Makefile
更旧,因此这种情况将一直持续到您实际到达正确的时间。
There are two ways to get rid of this behavior:有两种方法可以摆脱这种行为:
.pro
file's timestamp is in the past (not recommended).pro
文件的时间戳过去(不推荐).pro
file..pro
文件。 Even a trivial edit like a new comment should be enough.Had the same problem with latest version of QtCreator (3.6.1 with Qt 5.6.0).与最新版本的 QtCreator(3.6.1 和 Qt 5.6.0)有同样的问题。
Answer proposed by "Zeta" did not help. “Zeta”提出的答案没有帮助。
Disabling "Shadow build" in project options fixed the problem for me.在项目选项中禁用“Shadow build”为我解决了这个问题。 That's a good workaround.
这是一个很好的解决方法。
Finally shorten file names (somes where huge) to fix the issue:最后缩短文件名(有些文件名很大)以解决问题:
Issue then disappeared (even with shadow build, it's probably related as shadow-builds are using an output folder with a very long name).然后问题消失了(即使使用影子构建,它也可能与影子构建使用名称很长的输出文件夹有关)。
There's apparently a bug when file paths are too long (>~170, found a post on a forum reporting that ).当文件路径太长时,显然存在一个错误(>~170, 在论坛上发现了一个报告该问题的帖子)。
An alternative is also to change the pattern used by QtCreator for shadow builds.另一种方法是更改 QtCreator 用于阴影构建的模式。 This can be modified from the QtCreator options and you can then make the name shorter, this is another way to quickly and easily fix the issue.
这可以从 QtCreator 选项中修改,然后您可以缩短名称,这是另一种快速轻松解决问题的方法。
I wrote a python script that loops through recursively through all the files of the project and simply just resaves the files.我写了一个 python 脚本,它递归地遍历项目的所有文件,只是重新保存文件。 That updated the timestamp and corrected the QMake Infinite loop.
这更新了时间戳并更正了 QMake 无限循环。 It now compiles correctly.
它现在可以正确编译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.