[Solved] QTSerialPort, 4.8.4 [install_target_headers] Error 1

  • I want to install SerialPort on QT4.8.4 on my computer for development of GUI on Beaglebone Black.
    I followed the steps "here: ":http://qt-project.org/wiki/QtSerialPort#e290b0f84383a96ecdf7f6b720b72092

    @Recommended steps to build the QtSerialPort library for Qt4/Qt5 from QtCreator:

    download and unpack the QtSerialPort sources
    run QtCreator and open the “qtserialport.pro” project file
    get to “Projects->(Your Kit)->Build->Build Steps”
    add a new make “Build Step” and write to the “Make arguments” the install target
    from the menus, select “Rebuild Project qtserialport”


    In the last step "Rebuild Project qtserialport", I get "install_target_headers" Error
    Please help me solve this.

    The following is the last few lines of Compile Output window:

    @cd serialport/ && /usr/bin/make -f Makefile install
    make[2]: Entering directory /home/aswin/Downloads/build-qtserialport-Beaglebone-Debug/src/serialport' mkdir: cannot create directory/opt/qt/include/QtSerialPort/': Permission denied
    make[2]: Leaving directory /home/aswin/Downloads/build-qtserialport-Beaglebone-Debug/src/serialport' make[1]: Leaving directory/home/aswin/Downloads/build-qtserialport-Beaglebone-Debug/src'
    make[2]: *** [install_target_headers] Error 1
    make[1]: *** [sub-serialport-install_subtargets] Error 2
    make: *** [sub-src-install_subtargets-ordered] Error 2
    02:27:19: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project qtserialport (kit: Beaglebone)
    When executing step 'Make'
    02:27:19: Elapsed time: 00:37.@

  • Lifetime Qt Champion


    You are trying to infall QtSerialPort in a folder where you don't have the rights to write. You'll need to run sudo make install

  • Hi,

    Thanks for the reply.

    When I type 'sudo install' in Make Arguments, it appears as 'make sudo install in /home/aswin/Downloads/build-qtserialport-Beaglebone-Debug'.

    If it is to run as root, 'sudo' should appear before 'make', right? How do I do it?

    I'm new to Linux. Please help.

  • Lifetime Qt Champion

    like I wrote it's

    @sudo make install@

  • Hi,

    I tried your suggestion and received the following error in Compile Output window:

    @make[3]: Leaving directory /home/aswin/Downloads/build-qtserialport-Beaglebone-Debug/tests/manual/qserialport' make[2]: Leaving directory/home/aswin/Downloads/build-qtserialport-Beaglebone-Debug/tests/manual'
    make[1]: Leaving directory /home/aswin/Downloads/build-qtserialport-Beaglebone-Debug/tests' 08:56:00: The process "/usr/bin/make" exited normally. 08:56:00: Starting: "/usr/bin/make" sudo make install make: *** No rule to make targetsudo'. Stop.
    08:56:00: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project qtserialport (kit: Beaglebone)
    When executing step 'Make'
    08:56:00: Elapsed time: 00:42.@

    Screenshot of what I did:

  • Lifetime Qt Champion

    If you look again at your screen shot you'll see that you have

    @make sudo make install@

    AFAIK, you'll need to call sudo make install from a terminal.

  • Hi,
    Could you tell how to go about it?
    If it could take lots of time to get it right, please tell if it's possible to acess serialport from QT without serialport library support.

    This is my requirement:

    1. Access the serial port (ttyO0) to send 4-5 bytes.
    2. Poll the serial port (interrupt is also fine) to receive one byte and respond by sending 3-4 bytes.
    3. After several seconds, receive 80-100kB of data and store in a text file.
    4. Acknowledge by sending one byte.

    In short, I just need to know how to poll and send data to the serial port (/dev/ttyO0) without installing Serialport library.

    Thank you.

  • Lifetime Qt Champion

    Just open a terminal, go to the directory where you build QtSerialPort and call sudo make install

  • Hi,

    I logged into Ubuntu as root and then ran the build process for serialport. Now the autocomplete feature in QT suggests 'Qtserialport' when I type Qt. So I guess it's installed. Will try running small program to access the port and get back. Thanks a lot.

  • Lifetime Qt Champion

    You're welcome !

    Don't forget, don't do development as root.

    Since it's all working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

  • Can you please update this thread? I don't know how to get to "sudo make install" I'm trying to crosscompile on a beaglebone. is there an extension to this command? I'm receiving error:
    make: *** No rule to make target 'instal'. stop.

  • Sorry. I actually fixed it. Since I work on Beaglebone, there is a seperate build file created out of project one. build-{project name}-BeagleBone-Debug

    Have to go to this directory and type "sudo make install"

    and CONFIG += serialport
    on the .pro file's 2nd line; of project where this will be used.

    note: I was struggled a lot, so I hope will be useful for anyone working with cross compiling and QtSerialPort

  • Many thanks for updating.

  • Please let me know if you can get the serial port (UART) working.

    After installation I ran the sample code given on QTSerialPort wiki, but it detected only the USB port. Any idea why the serialport (ttyO0) doesn't get detected? http://qt-project.org/forums/viewthread/44916/#185469

  • Yeah. I work with rfid reader through usb, but i can only see COM ports. Maybe CreateFile for a com port, read from ttyO0 and write on the new file? if QSerialPort is essential. If not you can stick to reading from the UART file.

    I might be wrong. I just started to use C++ and Qt.

Log in to reply