2016-07-25 182 views
0

想安裝以下這些序列是由硬件供應商建議的Qt Creator中未聲明...qtserialport ...錯誤:「Q_NULLPTR」在此範圍

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 

,但我在最後決定你得到的錯誤:

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); 
              ^

在計算器上的一些建議增加QMAKE_CXXFLAGS += -std=c++0x,別人CONFIG += c++11.pro文件。這些對我來說不起作用......實際上至少有兩個.pro文件......哪一個我需要修正?

有什麼建議嗎?

+0

你爲什麼要試圖建立qtserialport如果你只需要安裝QtCreator? Ubuntu已經在他們的檔案中有一個QtCreator的版本,所以你可以用'apt-get install qtcreator'來安裝它。 – rm5248

回答

1

的Q_NULLPTR聲明INT頭文件qserialportglobal.h,所以你需要做的僅僅是在的#include的qserialport.h文件