qtserialport. error: ' Q_NULLPTR '未在此范围内声明。

时间:2021-05-20 23:39:46

Am trying to install qt creator following these sequences suggested by a hardware provider...

正在尝试安装qt创建者,按照硬件提供者建议的这些序列…

sudo apt-get install libudev-dev
git clone git://code.qt.io/qt/qtserialport.git && cd qtserialport
git checkout origin/old/5.2
cd .. 
mkdir qtserialport-build && cd qtserialport-build 
qmake ../qtserialport/qtserialport.pro 
make && sudo make install

cd ../qtserialport/ && git checkout origin/5.3
cd ../qtserialport-build/
make

But am getting errors at the last make:

但是在最后的时候会犯错误:

In file included from /home/polar/soft/lib/qt/qtserialport/src/serialport/qserialport.cpp:45:0:
/home/polar/soft/lib/qt/qtserialport/src/serialport/qserialport.h:190:44: 

error: ‘Q_NULLPTR’ was not declared in this scope
     explicit QSerialPort(QObject *parent = Q_NULLPTR);
                                            ^

On * some suggested to add QMAKE_CXXFLAGS += -std=c++0x, others CONFIG += c++11 to the .pro file. These did not work for me.... In fact there are at least two .pro files... which one I need amendment?

在*上,一些人建议添加QMAKE_CXXFLAGS += -std=c++0x,其他配置+= c++11到。pro文件。这些对我没用事实上,至少有两个。pro文件…哪一个我需要修改?

Any suggestions please?

有什么建议吗?

1 个解决方案

#1


1  

the Q_NULLPTR is declared int the header file qserialportglobal.h ,so you just need to do is #include in the qserialport.h file

Q_NULLPTR被声明为头文件qserialportglobal。所以你只需要在qserialport中包含#include。h文件

#1


1  

the Q_NULLPTR is declared int the header file qserialportglobal.h ,so you just need to do is #include in the qserialport.h file

Q_NULLPTR被声明为头文件qserialportglobal。所以你只需要在qserialport中包含#include。h文件