[SOLVED]QtSerialPort installation - details would be welcome
-
Thanks. Unfortunately it found nothing.
However, in the meantime I managed to execute the following (after I've created a serialport-build folder):
@
cd /home/notebook/WORK/Qt/qt-qtserialport/serialport-build
qmake ../serialport-src/qtserialport.pro
sudo make install
@Now I've got a directory with example, include and src folders, containing .h, .so, .prl, .o, .cpp files. How can I use them? The wiki says that I should add Qt +=serialport to my projects .pro file but it won't compile...probably I need to set the dependencies?
There is another thing in the wiki:
@
#include <QtAddOnSerialPort/serialport.h>
#include <QtAddOnSerialPort/serialportinfo.h>
@I can't find such directory like 'QtAddOnSerialPort'.
-
Are you sure you are using Qt 5 qmake ? If you also have Qt 4 dev-tools installed you might be using the wrong one
-
bq. Are you sure you are using Qt 5 qmake ? If you also have Qt 4 dev-tools installed you might be using the wrong one
How can I check that?
-
Either:
@which qmake@ will give you the complete path to qmake
or
@qmake --version@ will give you the information about qmake/Qt
-
Thanks SGaist, I really appreciate your patience. I've received the following:
@
notebook@notebook-K50IJ:~$ which qmake
/usr/bin/qmake
notebook@notebook-K50IJ:~$ qmake --version
QMake version 2.01a
Using Qt version 4.8.3 in /usr/lib/i386-linux-gnu
notebook@notebook-K50IJ:~$
@However, in Qt Creator, I'm using Qt5.0.1 and Qt Creator 2.6.2.
-
So it means that you compile QtSerialPort for Qt 4.8.3 (not a bad thing)
You have to go back to your build directory, remove everything from it, and then run the same command as before but giving the full path to Qt 5 qmake i.e
@/usr/local/PATH_TO_QT5_QMAKE/qmake ../qtserialport-src
make
sudo make install
@
Don't forget to make first and then make install, otherwise you will build as root -
@Don’t forget to make first and then make install, otherwise you will build as root@
Yes, I did it that way before and had to google how to delete all those locked folders. Before I try your suggestion I've got a question: I checked into usr/include folder and found a QtSerialPort directory with the header files serialport.h and serialportinfo.h (probably these are those header files which are mentioned in the wiki, but under 'QtSerialPort' directory instead of 'QtAddOnSerialPort'). Do I need to delete this usr/include/QtSerialPort directory (or uninstall it etc.) before I try your suggestion?
-
If you got no use of QtSerialPort for Qt 4 you can do a @sudo make uninstall@ before removing the folder content.
Otherwise, I'm pretty sure the include folder will be the same for Qt 5. The include files don't change but the libraries will.
You'll have to change your code accordingly using QtSerialPort rather than QtAddOnSerialPort
-
Success! At least so far.
In my custom project I placed the necessary includes:
@
#include <QtSerialPort/qserialport.h>
#include <QtSerialPort/qserialportinfo.h>
@and added
@
QT += widgets serialport
@It compiles.
Thank you for yor help!
-
You're welcome !
Don't forget to change the thread subject to solved
-
Done and thanks a million!