openhumanoids / signal-scope

A live plotting tool for LCM message fields.
BSD 3-Clause "New" or "Revised" License
13 stars 18 forks source link

cannot compile - issues with qwt #25

Closed jbcolme closed 8 years ago

jbcolme commented 8 years ago

I'm in ubuntu. I was already using signal-scope. Made a fresh clone and now I cannot compile. The first thing was that signal-scope could not find qwt:

    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files:
    QWT_INCLUDE_DIR

Yes I did

sudo apt-get install libqwt-dev

But the headers were not in /usr/local/lib but in /usr/local/qwt-6.1.2/include. So instead of modifying the CMakeLists file I made a symbolic link:

     cd /usr/local/lib
     sudo ln -s ../qwt-6.1.2/include qwt

So that cmake could find qwt and the variable QWT_INCLUDE_DIR was indeed defined. But then I got a bunch of errors when linking (which I list below). I might be wrong, but I had similar errors when I moved a project I was working on to qwt 6. I had so much trouble between Qt 4, Qwt 6, catkin and cmake that I ended up deciding to use qcustomplot. It may be that I have different versions of qwt installed or something like that. I'm going over it trying to find if I have something broken on my side.

CMakeFiles/signal-scope.dir/moc_plot.cxx.o:(.rodata._ZTV4Plot[_ZTV4Plot]+0x40): undefined reference to `QwtPlot::eventFilter(QObject*, QEvent*)'
CMakeFiles/signal-scope.dir/moc_plot.cxx.o:(.rodata._ZTV4Plot[_ZTV4Plot]+0x1d8): undefined reference to `QwtPlot::getCanvasMarginsHint(QwtScaleMap const*, QRectF const&, double&, double&, double&, double&) const'
CMakeFiles/signal-scope.dir/moc_plot.cxx.o:(.rodata._ZTV4Plot[_ZTV4Plot]+0x1e8): undefined reference to `QwtPlot::itemToInfo(QwtPlotItem*) const'
CMakeFiles/signal-scope.dir/moc_plot.cxx.o:(.rodata._ZTV4Plot[_ZTV4Plot]+0x1f0): undefined reference to `QwtPlot::infoToItem(QVariant const&) const'
CMakeFiles/signal-scope.dir/plot.cpp.o: In function `Plot::initBackground()':
plot.cpp:(.text+0x4da): undefined reference to `QwtPlotMarker::QwtPlotMarker(QString const&)'
plot.cpp:(.text+0x602): undefined reference to `QwtPlotMarker::QwtPlotMarker(QString const&)'
CMakeFiles/signal-scope.dir/plot.cpp.o: In function `Plot::Plot(QWidget*)':
plot.cpp:(.text+0xa78): undefined reference to `QwtPlotZoomer::QwtPlotZoomer(QWidget*, bool)'
plot.cpp:(.text+0xabc): undefined reference to `QwtEventPattern::setMousePattern(QwtEventPattern::MousePatternCode, Qt::MouseButton, QFlags<Qt::KeyboardModifier>)'
plot.cpp:(.text+0xad8): undefined reference to `QwtEventPattern::setMousePattern(QwtEventPattern::MousePatternCode, Qt::MouseButton, QFlags<Qt::KeyboardModifier>)'
plot.cpp:(.text+0xb4f): undefined reference to `QwtPlotMagnifier::QwtPlotMagnifier(QWidget*)'
plot.cpp:(.text+0xb79): undefined reference to `QwtMagnifier::setMouseButton(Qt::MouseButton, QFlags<Qt::KeyboardModifier>)'
CMakeFiles/signal-scope.dir/plot.cpp.o: In function `Plot::updateTicks()':
plot.cpp:(.text+0x1398): undefined reference to `QwtScaleDiv::range() const'
plot.cpp:(.text+0x13be): undefined reference to `QwtScaleDiv::lowerBound() const'
plot.cpp:(.text+0x1458): undefined reference to `QwtScaleDiv::upperBound() const'
plot.cpp:(.text+0x147f): undefined reference to `QwtScaleDiv::range() const'
plot.cpp:(.text+0x157e): undefined reference to `QwtScaleDiv::lowerBound() const'
plot.cpp:(.text+0x1632): undefined reference to `QwtScaleDiv::upperBound() const'
CMakeFiles/signal-scope.dir/plot.cpp.o: In function `MyPanner::eventFilter(QObject*, QEvent*)':
plot.cpp:(.text._ZN8MyPanner11eventFilterEP7QObjectP6QEvent[_ZN8MyPanner11eventFilterEP7QObjectP6QEvent]+0xda): undefined reference to `QwtScaleDiv::lowerBound() const'
plot.cpp:(.text._ZN8MyPanner11eventFilterEP7QObjectP6QEvent[_ZN8MyPanner11eventFilterEP7QObjectP6QEvent]+0x10a): undefined reference to `QwtScaleDiv::upperBound() const'
CMakeFiles/signal-scope.dir/plot.cpp.o:(.rodata._ZTV8MyZoomer[_ZTV8MyZoomer]+0x70): undefined reference to `QwtPicker::pickArea() const'
CMakeFiles/signal-scope.dir/plot.cpp.o:(.rodata._ZTV8MyZoomer[_ZTV8MyZoomer]+0x88): undefined reference to `QwtPicker::rubberBandMask() const'
collect2: error: ld returned 1 exit status
patmarion commented 8 years ago

Which version of Ubuntu are you using? The headers should be found here:

/usr/include/qwt

If you have headers in /usr/local/qwt-6.1.2/include then perhaps you manually installed a copy of qwt? If you don't need that, you should remove that. Also, you should remove the symlink you created, that is not needed.

Perhaps you have link errors because you told signal-scope to use the wrong qwt headers. Please do a clean build of signal-scope and make sure that the qwt headers and library variable are pointed to the system version of qwt, not the version in /usr/local.

If you still have trouble, please post your full CMakeCache.txt file (in the pod-build directory) so that I can help debug.

jbcolme commented 8 years ago

Done. Yes it was indeed an issue on my side. I removed the headers in /usr/local/qwt-6.1.2 and reinstalled the libqwt-dev package and it worked. I guess I had manually installed it long time ago. Thanks for your answering so quickly. I was about to try another version of qwt.