【问题标题】:'qNextPowerOfTwo' was not declared in this scope - Qt'qNextPowerOfTwo' 未在此范围内声明 - Qt
【发布时间】:2017-01-27 21:15:04
【问题描述】:

我最近在 Lubuntu 中安装了 Qt,但出现以下错误

此函数由文件中包含的 QtMath 库提供。

这里有什么建议吗?我在 Windows 中有相同的项目,但我没有这样的问题。 谢谢你的时间。 最好的问候

彼得

附:我附上了 .pro 文件,问题的相关代码已经在图像中。我正在使用 Qt 5.2.1 (GCC 4.8.2, 32bit)

#-------------------------------------------------
#
# Project created by QtCreator 2016-04-26T18:35:07
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

QMAKE_CXXFLAGS += -std=c++0x

TARGET = WaveMod
TEMPLATE = app


SOURCES +=\
    mainwindow.cpp \
trace_ex.cpp \
trace_group_ex.cpp \
qcustomplot.cpp \
main.cpp \
fft_complx.cpp \
geom_ex.cpp


HEADERS  += mainwindow.h \
trace_ex.h \
trace_group_ex.h \
qcustomplot.h \
fft_complx.h \
geom_ex.h \

FORMS    += mainwindow.ui \
trace_ex.ui \
trace_group_ex.ui \
geom_ex.ui

DISTFILES += \
geom_map.qml

【问题讨论】:

  • 你有什么版本的qt?
  • 请显示 .pro 并分享您的代码。

标签: linux qt qtmath


【解决方案1】:

documentation of the function 中写着。

此功能是在 Qt 5.4 中引入的。

如果您需要该功能,请尝试升级您的 Qt 设置,或查看here

【讨论】:

  • 谢谢马丁,一旦我升级了错误就消失了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-20
  • 2016-08-09
相关资源
最近更新 更多