gpt4 book ai didi

qt - 编译 Qt 源代码时出错

转载 作者:行者123 更新时间:2023-12-02 04:49:30 25 4
gpt4 key购买 nike

我四处寻找这个问题的解决方案,但无济于事。编译 Qt 时,它运行良好大约 60 秒,直到我得到这个并将我踢出局:

In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h
:65,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
from ..\..\..\include/QtCore/../../src/corelib/global/qglobal.h
:89,
from ..\..\..\include/QtCore/qglobal.h:1,
from ..\..\..\include/QtCore/../../src/corelib/tools/qalgorithm
s.h:45,
from ..\..\..\include/QtCore/qalgorithms.h:1,
from ..\..\..\include/QtCore/../../src/corelib/tools/qvector.h:
45,
from ..\..\..\include/QtCore/qvector.h:1,
from ..\..\..\include\QtCore/../../src/corelib/tools/qstack.h:4
5,
from ..\..\..\include\QtCore/qstack.h:1,
from parser.h:45,
from moc.h:45,
from moc.cpp:42:
c:\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
{ return (float)(_hypot (x, y)); }
^
Makefile.Release:307: recipe for target '.obj/release/moc.o' failed
mingw32-make[4]: *** [.obj/release/moc.o] Error 1
mingw32-make[4]: Leaving directory 'C:/Qt/QtS/qtbase/src/tools/moc'
Makefile:34: recipe for target 'release' failed
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Leaving directory 'C:/Qt/QtS/qtbase/src/tools/moc'
Makefile:82: recipe for target 'sub-moc-make_first' failed
mingw32-make[2]: *** [sub-moc-make_first] Error 2
mingw32-make[2]: Leaving directory 'C:/Qt/QtS/qtbase/src'
Makefile:41: recipe for target 'sub-src-make_first' failed
mingw32-make[1]: *** [sub-src-make_first] Error 2
mingw32-make[1]: Leaving directory 'C:/Qt/QtS/qtbase'
Makefile:63: recipe for target 'module-qtbase-make_first' failed
mingw32-make: *** [module-qtbase-make_first] Error 2

C:\Qt\QtS>

我正在使用 MinGW 进行编译,这是我第一次编译源代码,所以我不知道该怎么做。

最佳答案

如果您用 Google 搜索 error: '_hypot' was not declared in this scope,您会发现来自多个不同项目的多个报告。看起来像一个 MinGW 错误。如果这是真的,你无能为力。

您真的需要 32 位 Qt 吗?据谷歌称,至少有一个 64 位 MinGW 没有这个错误。

我会试试的。也许您找到了更新的 MinGW 版本?

http://mingw-w64.yaxm.org/doku.php

编辑:刚刚找到:https://wiki.qt.io/MinGW

There are binary installers targetting MinGW for both Qt 4 and Qt 5. Up to Qt 4.8.6, Qt 4 ones are built with a MinGW.org toolchain using gcc 4.4. Newer Qt 4.8 binary packages ship with a mingw-w64 based toolchain. For Qt 5, a newer MinGW-w64 toolchain is actually required.

关于qt - 编译 Qt 源代码时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30007725/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com