Originally Posted by
Uwe
ld.so.conf is for linking dynamically at runtime and doesn't explain any issues, when building an application. So whatever you did - I question, that this was the solution.
Ah, good point. I'm not sure what I did differently.
When I try to make my own simpleplot project based of the example I get the following error during building:
g++ -m64 -Wl,-O1 -o qwt simpleplot.o -L/usr/X11R6/lib64 -L/usr/local/qwt-6.1.0/lib -lqwt -lQt5Svg -L/usr/lib/x86_64-linux-gnu -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
/usr
/local
/qwt
-6.1.0
/lib
/libqwt.
so: undefined reference to `
QMetaType::unregisterConverterFunction(int,
int)' /usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5PrintSupport.so.5: undefined reference to `vtable for QDialogPrivate'
/usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5PrintSupport.so.5: undefined reference to `QDialogPrivate::canBeNativeDialog() const'
/usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QMetaType::registerConverterFunction(QtPrivate::AbstractConverterFunction const*, int, int)'
/usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5PrintSupport.so.5: undefined reference to `typeinfo for QDialogPrivate'
/usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QScrollArea::viewportSizeHint() const'
/usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5OpenGL.so.5: undefined reference to `QOpenGLExtensionMatcher::QOpenGLExtensionMatcher()'
/usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QMetaType::hasRegisteredConverterFunction(int, int)'
/usr
/local
/bin
/qt
/5.2.1
/gcc_64
/lib
/libQt5PrintSupport.
so.5
: undefined reference to `
QComboBox::currentData(int) const' collect2: error: ld returned 1 exit status
make: *** [qwt] Error 1
g++ -m64 -Wl,-O1 -o qwt simpleplot.o -L/usr/X11R6/lib64 -L/usr/local/qwt-6.1.0/lib -lqwt -lQt5Svg -L/usr/lib/x86_64-linux-gnu -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
/usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QMetaType::unregisterConverterFunction(int, int)'
/usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5PrintSupport.so.5: undefined reference to `vtable for QDialogPrivate'
/usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5PrintSupport.so.5: undefined reference to `QDialogPrivate::canBeNativeDialog() const'
/usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QMetaType::registerConverterFunction(QtPrivate::AbstractConverterFunction const*, int, int)'
/usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5PrintSupport.so.5: undefined reference to `typeinfo for QDialogPrivate'
/usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QScrollArea::viewportSizeHint() const'
/usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5OpenGL.so.5: undefined reference to `QOpenGLExtensionMatcher::QOpenGLExtensionMatcher()'
/usr/local/qwt-6.1.0/lib/libqwt.so: undefined reference to `QMetaType::hasRegisteredConverterFunction(int, int)'
/usr/local/bin/qt/5.2.1/gcc_64/lib/libQt5PrintSupport.so.5: undefined reference to `QComboBox::currentData(int) const'
collect2: error: ld returned 1 exit status
make: *** [qwt] Error 1
To copy to clipboard, switch view to plain text mode
Here is the very simple .pro file
TARGET = qwt
TEMPLATE = app
QT += widgets
CONFIG += qwt
SOURCES += src/simpleplot.cpp
TARGET = qwt
TEMPLATE = app
QT += widgets
CONFIG += qwt
SOURCES += src/simpleplot.cpp
To copy to clipboard, switch view to plain text mode
And finally, here is simpleplot.cpp (essentially copied from the examples folder)
#include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_symbol.h>
#include <qwt_legend.h>
int main( int argc, char **argv )
{
plot.setTitle( "Plot Demo" );
plot.setCanvasBackground( Qt::white );
plot.
setAxisScale( QwtPlot::yLeft,
0.0,
10.0 );
grid->attach( &plot );
curve->setTitle( "Some Points" );
curve->setPen( Qt::blue, 4 ),
curve
->setRenderHint
( QwtPlotItem::RenderAntialiased,
true );
curve->setSymbol( symbol );
curve->setSamples( points );
curve->attach( &plot );
plot.resize( 600, 400 );
plot.show();
return a.exec();
}
#include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_symbol.h>
#include <qwt_legend.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QwtPlot plot;
plot.setTitle( "Plot Demo" );
plot.setCanvasBackground( Qt::white );
plot.setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );
plot.insertLegend( new QwtLegend() );
QwtPlotGrid *grid = new QwtPlotGrid();
grid->attach( &plot );
QwtPlotCurve *curve = new QwtPlotCurve();
curve->setTitle( "Some Points" );
curve->setPen( Qt::blue, 4 ),
curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ) );
curve->setSymbol( symbol );
QPolygonF points;
points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 )
<< QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 )
<< QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 );
curve->setSamples( points );
curve->attach( &plot );
plot.resize( 600, 400 );
plot.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Added after 1 26 minutes:
I did a simple rebuild of qwt and it solved my compile/linker problems. Now when I run the app I get
"Segmentation fault"
With no other info.
Why is this so hard for me ?!
EDIT: The problem was another qwt lib that was incompatible. I solved it with ldd. Finally working. I still have no idea what the problems were. Seemed my first builds just weren't working for some reason.
Bookmarks