cannot find -lqwt-qt5 error
-
I am in the process of taking over a Raspberry pi project who's developer left. Its runing on raspberrian legacy. I am a linux novice. I have been able to get almost all of the tool chain working except for linking in qwt. When I go to make the project I get the error "/usr/bin/ld: cannot find -lqwt-qt5" shown below.
Below that is the make file. It seems that it wants the qwt libraries in /usr/lib which is where I put them with the qwtconfig.pri
The top part of the make file is shown below. It shows that its trying to access the library -L$(SYSROOT)/usr/lib/ -lqwt-qt5 but it can not find it. Once I changed the install path to /usr/lib, it put the qwt lib files in this directory but I do not see a "qwt-qt5" type of file(also listed below). What am I doing wrong here? Where do I get the library file qwt-qt5?
Ken
Error:
pi@raspberrypi:~/Desktop/Double_Die $ make VERBOSE=1 g++ -Wl,-O1 -o Double main.o deuce.o debug.o xml.o config_xml.o tab_rdo.o tab.o tab_prf_rng.o keyboard.o tab_prf_stp.o tab_prf.o storage.o file_data.o file_linearity.o profile_xml.o ... moc_tab_lin_plt.o moc_tab_plt.o moc_status.o moc_tab_prf_pup.o moc_ktsstyle.o moc_login.o moc_thread_tvc.o moc_tab_prf_box.o moc_tab_tst.o moc_tab_prf_oep.o moc_Password.o -L/usr/lib/ -lqwt-qt5 -L/usr/local/lib/ -lwiringPi -lQt5Widgets -lQt5Gui -lQt5SerialPort -lQt5Core -lGLESv2 -lpthread -latomic /usr/bin/ld: cannot find -lqwt-qt5 collect2: error: ld returned 1 exit status make: *** [Makefile:343: Double] Error 1
MAKEFILE
############################################################################# # Makefile for building: Deuce # Generated by qmake (3.1) (Qt 5.11.3) # Project: Deuce.pro # Template: app # Command: /usr/lib/qt5/bin/qmake -o Makefile Deuce.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug ############################################################################# MAKEFILE = Makefile ####### Compiler, tools and options CC = gcc CXX = g++ DEFINES = -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB CFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES) CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES) INCPATH = -I. -I$(SYSROOT)/usr/include/qwt -I$(SYSROOT)/usr/include/ -I/home/pi/Desktop/Double_Die/../../../../../../qwt-6.2.0 -I/home/pi/Desktop/Double_Die/../../../../../../qwt-6.2.0/src -I/home/pi/Desktop/Double_Die/../../../../../../WiringPi-master/wiringPi -isystem /usr/include/arm-linux-gnueabihf/qt5 -isystem /usr/include/arm-linux-gnueabihf/qt5/QtWidgets -isystem /usr/include/arm-linux-gnueabihf/qt5/QtGui -isystem /usr/include/arm-linux-gnueabihf/qt5/QtSerialPort -isystem /usr/include/arm-linux-gnueabihf/qt5/QtCore -I. -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ QMAKE = /usr/lib/qt5/bin/qmake DEL_FILE = rm -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p COPY = cp -f COPY_FILE = cp -f COPY_DIR = cp -f -R INSTALL_FILE = install -m 644 -p INSTALL_PROGRAM = install -m 755 -p INSTALL_DIR = cp -f -R QINSTALL = /usr/lib/qt5/bin/qmake -install qinstall QINSTALL_PROGRAM = /usr/lib/qt5/bin/qmake -install qinstall -exe DEL_FILE = rm -f SYMLINK = ln -f -s DEL_DIR = rmdir MOVE = mv -f TAR = tar -cf COMPRESS = gzip -9f DISTNAME = Deuce1.0.0 DISTDIR = /home/pi/Desktop/Double_Die/.tmp/Deuce1.0.0 LINK = g++ LFLAGS = LIBS = $(SUBLIBS) -L$(SYSROOT)/usr/lib/ -lqwt-qt5 -L$(SYSROOT)/usr/local/lib/ -lwiringPi -lQt5Widgets -lQt5Gui -lQt5SerialPort -lQt5Core -lGLESv2 -lpthread -latomic AR = ar cqs RANLIB = SED = sed STRIP = strip
qwtconfig.pri
################################################################ # Qwt Widget Library # Copyright (C) 1997 Josef Wilgen # Copyright (C) 2002 Uwe Rathmann # # This library is free software; you can redistribute it and/or # modify it under the terms of the Qwt License, Version 1.0 ################################################################ QWT_VER_MAJ = 6 QWT_VER_MIN = 2 QWT_VER_PAT = 0 QWT_VERSION = $${QWT_VER_MAJ}.$${QWT_VER_MIN}.$${QWT_VER_PAT} ###################################################################### # Install paths ###################################################################### QWT_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX] unix { QWT_INSTALL_PREFIX = /usr/lib # QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION-qt-$$QT_VERSION #QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION } win32 { QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION # QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION-qt-$$QT_VERSION } QWT_INSTALL_DOCS = $${QWT_INSTALL_PREFIX}/doc QWT_INSTALL_HEADERS = $${QWT_INSTALL_PREFIX}/include QWT_INSTALL_LIBS = $${QWT_INSTALL_PREFIX}
Partial Directory of /usr/lib
cups libpigpio.so.1 python3 dbus-1.0 libpyglib-2.0-python2.7.so.0 python3.7 dconf libpyglib-2.0-python2.7.so.0.0.0 qpdfview debug libpypy-c.so qt5 dhcpcd libqmi raspberrypi-sys-mods dhcpcd5 libqwt.so raspi-config doc libqwt.so.6 rc-gui dpkg libqwt.so.6.2 resolvconf eject libqwt.so.6.2.0
-
I am in the process of taking over a Raspberry pi project who's developer left. Its runing on raspberrian legacy. I am a linux novice. I have been able to get almost all of the tool chain working except for linking in qwt. When I go to make the project I get the error "/usr/bin/ld: cannot find -lqwt-qt5" shown below.
Below that is the make file. It seems that it wants the qwt libraries in /usr/lib which is where I put them with the qwtconfig.pri
The top part of the make file is shown below. It shows that its trying to access the library -L$(SYSROOT)/usr/lib/ -lqwt-qt5 but it can not find it. Once I changed the install path to /usr/lib, it put the qwt lib files in this directory but I do not see a "qwt-qt5" type of file(also listed below). What am I doing wrong here? Where do I get the library file qwt-qt5?
Ken
Error:
pi@raspberrypi:~/Desktop/Double_Die $ make VERBOSE=1 g++ -Wl,-O1 -o Double main.o deuce.o debug.o xml.o config_xml.o tab_rdo.o tab.o tab_prf_rng.o keyboard.o tab_prf_stp.o tab_prf.o storage.o file_data.o file_linearity.o profile_xml.o ... moc_tab_lin_plt.o moc_tab_plt.o moc_status.o moc_tab_prf_pup.o moc_ktsstyle.o moc_login.o moc_thread_tvc.o moc_tab_prf_box.o moc_tab_tst.o moc_tab_prf_oep.o moc_Password.o -L/usr/lib/ -lqwt-qt5 -L/usr/local/lib/ -lwiringPi -lQt5Widgets -lQt5Gui -lQt5SerialPort -lQt5Core -lGLESv2 -lpthread -latomic /usr/bin/ld: cannot find -lqwt-qt5 collect2: error: ld returned 1 exit status make: *** [Makefile:343: Double] Error 1
MAKEFILE
############################################################################# # Makefile for building: Deuce # Generated by qmake (3.1) (Qt 5.11.3) # Project: Deuce.pro # Template: app # Command: /usr/lib/qt5/bin/qmake -o Makefile Deuce.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug ############################################################################# MAKEFILE = Makefile ####### Compiler, tools and options CC = gcc CXX = g++ DEFINES = -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB CFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES) CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES) INCPATH = -I. -I$(SYSROOT)/usr/include/qwt -I$(SYSROOT)/usr/include/ -I/home/pi/Desktop/Double_Die/../../../../../../qwt-6.2.0 -I/home/pi/Desktop/Double_Die/../../../../../../qwt-6.2.0/src -I/home/pi/Desktop/Double_Die/../../../../../../WiringPi-master/wiringPi -isystem /usr/include/arm-linux-gnueabihf/qt5 -isystem /usr/include/arm-linux-gnueabihf/qt5/QtWidgets -isystem /usr/include/arm-linux-gnueabihf/qt5/QtGui -isystem /usr/include/arm-linux-gnueabihf/qt5/QtSerialPort -isystem /usr/include/arm-linux-gnueabihf/qt5/QtCore -I. -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ QMAKE = /usr/lib/qt5/bin/qmake DEL_FILE = rm -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p COPY = cp -f COPY_FILE = cp -f COPY_DIR = cp -f -R INSTALL_FILE = install -m 644 -p INSTALL_PROGRAM = install -m 755 -p INSTALL_DIR = cp -f -R QINSTALL = /usr/lib/qt5/bin/qmake -install qinstall QINSTALL_PROGRAM = /usr/lib/qt5/bin/qmake -install qinstall -exe DEL_FILE = rm -f SYMLINK = ln -f -s DEL_DIR = rmdir MOVE = mv -f TAR = tar -cf COMPRESS = gzip -9f DISTNAME = Deuce1.0.0 DISTDIR = /home/pi/Desktop/Double_Die/.tmp/Deuce1.0.0 LINK = g++ LFLAGS = LIBS = $(SUBLIBS) -L$(SYSROOT)/usr/lib/ -lqwt-qt5 -L$(SYSROOT)/usr/local/lib/ -lwiringPi -lQt5Widgets -lQt5Gui -lQt5SerialPort -lQt5Core -lGLESv2 -lpthread -latomic AR = ar cqs RANLIB = SED = sed STRIP = strip
qwtconfig.pri
################################################################ # Qwt Widget Library # Copyright (C) 1997 Josef Wilgen # Copyright (C) 2002 Uwe Rathmann # # This library is free software; you can redistribute it and/or # modify it under the terms of the Qwt License, Version 1.0 ################################################################ QWT_VER_MAJ = 6 QWT_VER_MIN = 2 QWT_VER_PAT = 0 QWT_VERSION = $${QWT_VER_MAJ}.$${QWT_VER_MIN}.$${QWT_VER_PAT} ###################################################################### # Install paths ###################################################################### QWT_INSTALL_PREFIX = $$[QT_INSTALL_PREFIX] unix { QWT_INSTALL_PREFIX = /usr/lib # QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION-qt-$$QT_VERSION #QWT_INSTALL_PREFIX = /usr/local/qwt-$$QWT_VERSION } win32 { QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION # QWT_INSTALL_PREFIX = C:/Qwt-$$QWT_VERSION-qt-$$QT_VERSION } QWT_INSTALL_DOCS = $${QWT_INSTALL_PREFIX}/doc QWT_INSTALL_HEADERS = $${QWT_INSTALL_PREFIX}/include QWT_INSTALL_LIBS = $${QWT_INSTALL_PREFIX}
Partial Directory of /usr/lib
cups libpigpio.so.1 python3 dbus-1.0 libpyglib-2.0-python2.7.so.0 python3.7 dconf libpyglib-2.0-python2.7.so.0.0.0 qpdfview debug libpypy-c.so qt5 dhcpcd libqmi raspberrypi-sys-mods dhcpcd5 libqwt.so raspi-config doc libqwt.so.6 rc-gui dpkg libqwt.so.6.2 resolvconf eject libqwt.so.6.2.0
-
I followed the directions given here. (https://qwt.sourceforge.io/qwtinstall.html) On the raspberry pi 3
From within the qwt-620 directory I used the commands
qmake qwt.pro
make
sudo make install
-
Fixed dir name...
I followed the directions given here. (https://qwt.sourceforge.io/qwtinstall.html) On the raspberry pi 3
From within the qwt-6.2.0 directory I used the commands
qmake qwt.pro
make
sudo make install
-
Here is the full pro file.
#------------------------------------------------- # # Project created by QtCreator 2019-04-23T16:28:20 # #------------------------------------------------- QT += core gui serialport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = Deuce TEMPLATE = app DEFINES += QT_DEPRECATED_WARNINGS LIBS += -L$(SYSROOT)/usr/lib/ -lqwt-qt5 -L$(SYSROOT)/usr/local/lib/ -lwiringPi INCLUDEPATH += $(SYSROOT)/usr/include/qwt $(SYSROOT)/usr/include/ SOURCES += main.cpp\ deuce.cpp \ debug.cpp \ xml.cpp \ config_xml.cpp \ tab_rdo.cpp \ tab.cpp \ tab_prf_rng.cpp \ keyboard.cpp \ tab_prf_stp.cpp \ tab_prf.cpp \ storage.cpp \ file_data.cpp \ file_linearity.cpp \ profile_xml.cpp \ tab_cfg.cpp \ tab_ctl.cpp \ thread_dev.cpp \ timer_com.cpp \ tab_lin_ctl.cpp \ tab_dia.cpp \ tab_img.cpp \ tab_iro.cpp \ tab_lin_plt.cpp \ tab_plt.cpp \ status.cpp \ tab_prf_pup.cpp \ ktsstyle.cpp \ login.cpp \ thread_tvc.cpp \ serialport.cpp \ tab_prf_box.cpp \ tab_tst.cpp \ tab_prf_oep.cpp \ password.cpp HEADERS += deuce.h \ include.h \ define.h \ debug.h \ struct.h \ xml.h \ config_xml.h \ tab_rdo.h \ tab.h \ tab_prf_rng.h \ keyboard.h \ tab_prf_stp.h \ tab_prf.h \ storage.h \ file_data.h \ file_linearity.h \ profile_xml.h \ tab_cfg.h \ tab_ctl.h \ thread_dev.h \ timer_com.h \ tab_lin_ctl.h \ tab_dia.h \ tab_img.h \ tab_iro.h \ tab_lin_plt.h \ tab_plt.h \ status.h \ tab_prf_pup.h \ ktsstyle.h \ login.h \ thread_tvc.h \ serialport.h \ tab_prf_box.h \ tab_tst.h \ tab_prf_oep.h \ password.h
-
It looks like your project file is expecting that the qwt library has been built with its TARGET variable in its project file (I think it's actually the src/src.pro project file) set to 'qwt-qt$${QT_VERSION}. You could probably just remove the '-qt5' from the LIBS line in your project file but if you are considering upgrading to Qt6, you probably want to build qwt so that it includes the Qt version in the lib filenames (and update your .pro file so the Qt version part of the Qwt library uses the $${QT_VERSION} variable and instead of a fixed version string). Then you can have Qt5 and Qt6 Qwt library files in the same directory and be able to easily switch between Qt versions for your project.
-
It looks like your project file is expecting that the qwt library has been built with its TARGET variable in its project file (I think it's actually the src/src.pro project file) set to 'qwt-qt$${QT_VERSION}. You could probably just remove the '-qt5' from the LIBS line in your project file but if you are considering upgrading to Qt6, you probably want to build qwt so that it includes the Qt version in the lib filenames (and update your .pro file so the Qt version part of the Qwt library uses the $${QT_VERSION} variable and instead of a fixed version string). Then you can have Qt5 and Qt6 Qwt library files in the same directory and be able to easily switch between Qt versions for your project.
@mchinand said in cannot find -lqwt-qt5 error:
ariable and instead of a fixed version string). Then you can have Qt5 and Qt6 Qwt library files in the same directory and be able to easily switch between Qt versions for your project.
Awesome! Thanks for the help here! I would not have gone down that folder like that. So the "default" install of qwt-6.2.0 has
TARGET = $$qwtLibraryTarget(qwt)
The macro for qwtLibraryTarget(xxxxxx) looks quite involved. But your saying I should just change this to
TARGET = qt$${QT_VERSION}
I will give this a try when I get home tonight from my day job. and then also have the customer look in this folder for to verify.
Again, thank you for this information. This make a lot more sense now.
Ken
-
@justdad said in cannot find -lqwt-qt5 error:
TARGET = $$qwtLibraryTarget(qwt)
The macro for qwtLibraryTarget(xxxxxx) looks quite involved. But your saying I should just change this to
TARGET = qt$${QT_VERSION}To match what your project expects, you want a combination of both of those.
TARGET = $$qwtLibraryTarget(qwt)-qt$${QT_VERSION)
Edit: I think it should be:
TARGET = $$qwtLibraryTarget(qwt-qt$${QT_VERSION})
Add a message line to the src.pro file so you can see what it gets set to when qmake is run rather than waiting until it is built:
message("Qwt TARGET set to $${TARGET}")