Yes, you should replace it with the path to your Qwt installation.
I did it, as I said, and the problem remains. I haven't found if I had to change it somewhere else.
One day, this will work !
To confirm.
You have Qwt 6.1 built with Qt5 and installed under /usr/local.
So this is what you get:
and you have a pro file like:Qt Code:
chrisw@newton ~ $ qmake -query QMAKEFEATURES /usr/local/qwt-6.1.0/featuresTo copy to clipboard, switch view to plain text mode
and a basic program like the one you posted earlier. Your code compiles without warning or error, but "doesn't work" when started..Qt Code:
QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = test TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui CONFIG += qwtTo copy to clipboard, switch view to plain text mode
If so, exactly what does "doesn't work" mean?
I don't have TARGET nor TEMPLATE in my .pro but appart from that you are right.
In my code, I only create a qwt object.
When I start the program, I have "realloc(): invalid pointer" followed by the backtrace and the memory map.
I just figured out that I had let the lines
Qt Code:
unix|win32: LIBS += -L$$PWD/../../../../../usr/local/qwt-6.1.0/lib/ -lqwt #INCLUDEPATH += $$PWD/../../../../../usr/local/qwt-6.1.0/include #DEPENDPATH += $$PWD/../../../../../usr/local/qwt-6.1.0/includeTo copy to clipboard, switch view to plain text mode
in the .pro while I thought I had suppressed them when wysota told me to.
Actually, the code only compiled because of them. New project, new try, new errors ; there I have (the most simple I can) :
Qt Code:
QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = qwt_test TEMPLATE = app CONFIG += qwt # hand added SOURCES += main.cppTo copy to clipboard, switch view to plain text mode
for the .pro
Qt Code:
#include <QApplication> #include<qwt_compass.h> int main(int argc, char *argv[]) { //MainWindow w; //w.show(); QwtCompass compass; compass.show(); return a.exec(); }To copy to clipboard, switch view to plain text mode
for main.cpp
That code does not compile. It returns :
Qt Code:
In function `MainWindow::on_actionTest_triggered()': error: undefined reference to `QwtCompass::QwtCompass(QWidget*)' error: collect2: ld returned 1 exit statusTo copy to clipboard, switch view to plain text mode
I had all reinstalled following the steps online, no more no less.
(First installation I had copied the .so but I was told I should not have.)
It is still "/usr/local/qwt-6.1.0/features/" since I have changed it with "qmake -set QMAKEFEATURES" and the right path. :-)
1. Make sure this is the right qmake that you are using
2. Make sure the directory contains the qwt.prf file
3. Make sure the qwt.prf file contains a reference to the qwt library
4. Show us the last compiler invocation for your project.
I compile with QtCreator ; Qt Version is autodetected with location of qmake the same as what I used to compile qwt. So this is OK I think.1. Make sure this is the right qmake that you are using
Which directory ? :s2. Make sure the directory contains the qwt.prf file
If it is qwt_root/features, yes it contains qwt.prf
it contains :3. Make sure the qwt.prf file contains a reference to the qwt library
Qt Code:
include ( ./qwtconfig.pri ) include ( ./qwtfunctions.pri ) contains(QWT_CONFIG, QwtDll) { DEFINES *= QWT_DLL } contains(QWT_CONFIG, QwtSvg) { QT *= svg } else { DEFINES *= QWT_NO_SVG } contains(QWT_CONFIG, QwtFramework) { INCLUDEPATH *= $${QWT_INSTALL_LIBS}/qwt.framework/Headers LIBS *= -F$${QWT_INSTALL_LIBS} } else { INCLUDEPATH *= $${QWT_INSTALL_HEADERS} LIBS *= -L$${QWT_INSTALL_LIBS} } qwtAddLibrary(qwt)To copy to clipboard, switch view to plain text mode
I compile in QtCreator. What should I show you ?4. Show us the last compiler invocation for your project.
I tell you what I can ! QtCreator tells me it uses qmake from the same path I have used to make qwt ; I believe that is what you ask. But as long as I am not sure, I tell you that I think it is OK. No need to be aggressive. Just tell me if this is your meaning of "the right qmake" or not !Don't think, please. Check.
So yes as I said.The one returned by qmake -query QMAKEFEATURES
The last compiler invocation (from the "compiler messages" pane).Qt Code:
14:48:37: Configuration unchanged, skipping qmake step. 14:48:37: Starting: "/usr/bin/make" g++ -m64 -Wl,-rpath,/home/developpeur/Qt5.0.2/5.0.2/gcc_64 -Wl,-rpath,/home/developpeur/Qt5.0.2/5.0.2/gcc_64/lib -o qwt_test main.o -L/usr/X11R6/lib64 -L/home/developpeur/Qt5.0.2/5.0.2/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread main.o: In function `main': /home/developpeur/developpement/stageCamille/build-qwt_test-Desktop_Qt_5_0_2_GCC_64bit-Debug/../qwt_test/main.cpp:9: undefined reference to `QwtCompass::QwtCompass(QWidget*)' /home/developpeur/developpement/stageCamille/build-qwt_test-Desktop_Qt_5_0_2_GCC_64bit-Debug/../qwt_test/main.cpp:12: undefined reference to `QwtCompass::~QwtCompass()' /home/developpeur/developpement/stageCamille/build-qwt_test-Desktop_Qt_5_0_2_GCC_64bit-Debug/../qwt_test/main.cpp:12: undefined reference to `QwtCompass::~QwtCompass()' collect2: ld returned 1 exit status make: *** [qwt_test] Error 1 14:48:37: The process "/usr/bin/make" exited with code 2. Error while building/deploying project qwt_test (kit: Desktop Qt 5.0.2 GCC 64bit) When executing step 'Make' 14:48:38: Elapsed time: 00:00.To copy to clipboard, switch view to plain text mode
Bookmarks