Search code examples
linuxqtqtmath

'qNextPowerOfTwo' was not declared in this scope - Qt


I recently installed Qt in Lubuntu and I'm getting the following error

Error showing that function qNextPowerOfTwo is not declared in this scope

This function is provided by QtMath library which IS included in the file.

enter image description here

any advice here? I have the same project in Windows but I have no such problem. Thanks for your time. Best regards

Peter

P.S. I enclose the .pro file the relevant code to the question is already in the images. I'm using 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

Solution

  • In the documentation of the function it says.

    This function was introduced in Qt 5.4.

    Try upgrading your Qt setup if you need that function, or have a look here.