PDA

View Full Version : problem when trying to compile it.



cbarmpar
21st December 2008, 02:11
hi all,

i am trying to compile the following code but I receive an error "launch failed. Binary not found". I am using eclipse. The strange think is that the first time I am trying to compile it it is finding errors. But when I try to change the error and compile it again i receive the error. I tried to clean the project but with no result. I think the code is correct.

Many thanks in advance,

Kindest regards,
Christos



#include "test2.h"
#include "/usr/include/qwt/qwt_plot.h"
#include "/usr/include/qwt/qwt_plot_curve.h"
test2::test2(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
QwtPlot *myPlot;
double x[100], y1[100], y2[100]; // x and y values

myPlot = new QwtPlot(this);

// add curves
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2");

for( int i=0; i<100; i++ )
{ x[i] = (double)i/50.0; y1[i] = sin(x[i]); y2[i] = cos(x[i]); }

// copy the data into the curves
curve1->setData(x, y1, 100);
curve2->setData(x, y2, 100);
curve1->attach(myPlot);
curve2->attach(myPlot);
// finally, refresh the plot
myPlot->replot();
}

jpn
16th January 2009, 21:16
Did you implement main() somewhere?