1
votes

I am trying to compile a project that uses QtSerialPort and I get a link error

g++ -m64 -Wl,-O1 -o eTerm main.o eterm.o tcpclient.o tcpserver.o udpserver.o serialserver.o qrc_eterm.o moc_eterm.o moc_tcpclient.o moc_tcpserver.o moc_udpserver.o moc_serialserver.o -L/usr/X11R6/lib64 -lQt5Widgets -L/usr/lib/x86_64-linux-gnu -lQt5SerialPort -ludev -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread /usr/bin/ld: cannot find -ludev collect2: error: ld returned 1 exit status make: *** [eTerm] Error 1

I am using QtCreator 5.2.1 under Kubuntu 14.04

udev is installed and is the last version. I only get this error when QtSerialPort is included / used, everything is fine for other projects.

#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
    #include <QtSerialPort/QtSerialPort>
#else
    #include <QSerialPort>
    #include <QSerialPortInfo>
#endif

The serial port is installed from libqt5serialport5-dev and libqt5serialport5 packages (I had some unsuccessful trials to install it from source at first).

Does anyone has an idea what could be causing this problem? Thanks!

1
/usr/bin/ld: cannot find -ludev Do you need -ludev? If so maybe install delvelopment libraries for udev.drescherjm

1 Answers

0
votes

Try to install package libudev-dev. For compiling you normally need a package ending on -dev which contains special compilation files. The packages without -dev are usually only for running programs which dynamically link to a library.