我正在尝试在OSX 10.10上编译qt5.3。当我跑步时,#34; make"我收到以下错误:
>cd widgets/ && ( test -e Makefile || /Volumes/Untitled/5.3/Src/qtbase/bin/qmake /Volumes/Untitled/5.3/Src/qtbase/src/widgets/widgets.pro -o Makefile ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -O2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_USING_NAMESPACE -DQT_BUILD_WIDGETS_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_GTK -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_ANDROID -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../../mkspecs/macx-clang -I. -I../../include -I../../include/QtWidgets -I../../include/QtWidgets/5.3.0 -I../../include/QtWidgets/5.3.0/QtWidgets -Idialogs -I.uic -I../../lib/QtGui.framework/Versions/5/Headers -I../../lib/QtGui.framework/Versions/5/Headers/5.3.0 -I../../lib/QtGui.framework/Versions/5/Headers/5.3.0/QtGui -I../../lib/QtCore.framework/Versions/5/Headers -I../../lib/QtCore.framework/Versions/5/Headers/5.3.0 -I../../lib/QtCore.framework/Versions/5/Headers/5.3.0/QtCore -I.moc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/AGL.framework/Headers -F/Volumes/Untitled/5.3/Src/qtbase/lib -o .obj/qlineedit_p.o widgets/qlineedit_p.cpp
widgets/qlineedit_p.cpp:352:15: error: call to 'qFuzzyCompare' is ambiguous
setCursor(qFuzzyCompare(m_opacity, 1.0) || !parentWidget() ? QCurso...
^~~~~~~~~~~~~
../../include/QtCore/../../src/corelib/global/qglobal.h:725:37: note:
candidate function
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2)
^
../../include/QtCore/../../src/corelib/global/qglobal.h:731:37: note:
candidate function
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(float p1, float p2)
^
../../include/QtGui/../../src/gui/painting/qmatrix.h:160:13: note: candidate
function
inline bool qFuzzyCompare(const QMatrix& m1, const QMatrix& m2)
^
../../include/QtGui/../../src/gui/painting/qtransform.h:332:13: note:
candidate function
inline bool qFuzzyCompare(const QTransform& t1, const QTransform& t2)
^
1 error generated.
make[3]: *** [.obj/qlineedit_p.o] Error 1
make[2]: *** [sub-widgets-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
>make: *** [module-qtbase-make_first] Error 2
我使用的配置选项是:
./ configure -release -opensource -confirm-license -qt-harfbuzz -qt-zlib -qt-libpng -qt-libjpeg -no-pch -qreal float -nomake examples -nomake tools -verbose -arch x86_64
非常感谢任何帮助。感谢。
答案 0 :(得分:1)
http://doc.qt.io/qt-5/qtglobal.html#qreal-typedef
您在调用中将qreal重新定义为float。默认值为double。
被调用的行读取:
setCursor(qFuzzyCompare(m_opacity, 1.0) || !parentWidget() ? QCursor(Qt::ArrowCursor) : parentWidget()->cursor());
m_opacity
是qreal,1.0
是双倍的。所以电话qFuzzyCompare(float, double)
确实是暧昧的。
您有两个选择:
qreal
定义为float
(与当前./configure调用中一样)qlineedit_p.cpp
并将通话更改为qFuzzyCompare(m_opacity, (qreal)1.0)
或qFuzzyCompare(m_opacity, 1.0f)
如果没有必要重新定义qreal的类型,我会选择它。