Jasvirbahl / b-tk

Automatically exported from code.google.com/p/b-tk
0 stars 0 forks source link

Mokka fails to compile under Ubuntu 12.04 #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. checkout current trunk (currently revision 1361)
2. configure using cmake
3. run make

What is the expected output? What do you see instead?
proper compilation, but instead I get the following errors:

In file included from /home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:43:0:
/home/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKContextActor.h:85:9: warning: 
extra tokens at end of #endif directive [enabled by default]
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp: In member function ‘void 
ChartWidget::refreshPlots()’:
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:297:14: error: ‘class 
vtkAxis’ has no member named ‘GetRange’
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:298:14: error: ‘class 
vtkAxis’ has no member named ‘GetRange’
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:303:29: error: no matching 
function for call to ‘vtkAxis::SetRange(double [2])’
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:303:29: note: candidate is:
/usr/include/vtk-5.8/vtkAxis.h:117:16: note: virtual void 
vtkAxis::SetRange(double, double)
/usr/include/vtk-5.8/vtkAxis.h:117:16: note:   candidate expects 2 arguments, 1 
provided
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:305:31: error: no matching 
function for call to ‘vtkAxis::SetRange(double [2])’
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:305:31: note: candidate is:
/usr/include/vtk-5.8/vtkAxis.h:117:16: note: virtual void 
vtkAxis::SetRange(double, double)
/usr/include/vtk-5.8/vtkAxis.h:117:16: note:   candidate expects 2 arguments, 1 
provided
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp: In member function 
‘virtual void VTKChartWidget::mousePressEvent(QMouseEvent*)’:
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:1637:11: error: ‘class 
vtkContextMouseEvent’ has no member named ‘SetInteractor’
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp: In member function 
‘virtual void VTKChartWidget::mouseReleaseEvent(QMouseEvent*)’:
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:1680:11: error: ‘class 
vtkContextMouseEvent’ has no member named ‘SetInteractor’
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp: In member function 
‘virtual void VTKChartWidget::mouseMoveEvent(QMouseEvent*)’:
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:1713:11: error: ‘class 
vtkContextMouseEvent’ has no member named ‘SetInteractor’
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp: In member function 
‘virtual void VTKChartWidget::wheelEvent(QWheelEvent*)’:
/home/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:1749:11: error: ‘class 
vtkContextMouseEvent’ has no member named ‘SetInteractor’

What version of the product are you using? On what operating system?
Revision 1361, Ubuntu 12.04, vtk-5.8 (provided by ubuntu)

Please provide any additional information below.

Original issue reported on code.google.com by martin.f...@gmail.com on 8 Nov 2012 at 12:58

GoogleCodeExporter commented 8 years ago
Just checked that it compiles fine with a custom installed vtk-5.10.

A compilation with vtk-5.8 would nevertheless be desirable as it simplifies 
building under Ubuntu 12.04 considerably.

Original comment by martin.f...@gmail.com on 8 Nov 2012 at 1:01

GoogleCodeExporter commented 8 years ago
Could you try this patch? It should resolve the issue.

Original comment by arnaud.barre on 8 Nov 2012 at 1:37

Attachments:

GoogleCodeExporter commented 8 years ago
Not quite working. I now get the following error:

/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.cpp: In member 
function ‘virtual void btk::VTKAxis::AutoScale()’:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.cpp:202:30: error: no 
matching function for call to ‘btk::VTKAxis::SetRange(double&, double&)’
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.cpp:202:30: note: 
candidate is:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note: virtual 
void btk::VTKAxis::SetRange(double*)
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note:   
candidate expects 1 argument, 2 provided
make[2]: *** [Code/VisSupport/VTK/CMakeFiles/BTKVTK.dir/btkVTKAxis.cpp.o] Error 
1
make[1]: *** [Code/VisSupport/VTK/CMakeFiles/BTKVTK.dir/all] Error 2

I tried to use a quick fix to replace /Code/VisSupport/VTK/btkVTKAxis.cpp:202
    this->SetRange(min, max);
with 
    double range[2];
    range[0] = min;
    range[1] = max;
    this->SetRange(range);

but this gave me additional errors: 
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp: In 
member function ‘void btk::VTKChartTimeSeries::SetBounds(double*)’:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:164:98: 
error: no matching function for call to ‘btk::VTKAxis::SetRange(double, 
double)’
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:164:98: 
note: candidate is:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note: virtual 
void btk::VTKAxis::SetRange(double*)
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note:   
candidate expects 1 argument, 2 provided
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:165:98: 
error: no matching function for call to ‘btk::VTKAxis::SetRange(double, 
double)’
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:165:98: 
note: candidate is:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note: virtual 
void btk::VTKAxis::SetRange(double*)
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note:   
candidate expects 1 argument, 2 provided
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp: In 
member function ‘virtual bool 
btk::VTKChartTimeSeries::MouseButtonReleaseEvent(const 
vtkContextMouseEvent&)’:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:884:58: 
error: no matching function for call to ‘btk::VTKAxis::SetRange(float&, 
float&)’
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:884:58: 
note: candidate is:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note: virtual 
void btk::VTKAxis::SetRange(double*)
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note:   
candidate expects 1 argument, 2 provided
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:885:58: 
error: no matching function for call to ‘btk::VTKAxis::SetRange(float&, 
float&)’
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:885:58: 
note: candidate is:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note: virtual 
void btk::VTKAxis::SetRange(double*)
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note:   
candidate expects 1 argument, 2 provided
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp: In 
constructor ‘btk::VTKChartTimeSeries::VTKChartTimeSeries()’:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:992:38: 
error: no matching function for call to ‘btk::VTKAxis::SetRange(double, 
double)’
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:992:38: 
note: candidate is:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note: virtual 
void btk::VTKAxis::SetRange(double*)
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note:   
candidate expects 1 argument, 2 provided
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:994:38: 
error: no matching function for call to ‘btk::VTKAxis::SetRange(double, 
double)’
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKChartTimeSeries.cpp:994:38: 
note: candidate is:
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note: virtual 
void btk::VTKAxis::SetRange(double*)
/spare1/mfelis/temp/btkhg/Code/VisSupport/VTK/btkVTKAxis.h:81:18: note:   
candidate expects 1 argument, 2 provided
make[2]: *** 
[Code/VisSupport/VTK/CMakeFiles/BTKVTK.dir/btkVTKChartTimeSeries.cpp.o] Error 1
make[1]: *** [Code/VisSupport/VTK/CMakeFiles/BTKVTK.dir/all] Error 2

Original comment by martin.f...@gmail.com on 8 Nov 2012 at 2:02

GoogleCodeExporter commented 8 years ago
I tried to add the missing SetRange function:

void VTKAxis::SetRange(double min, double max)
  {
    this->SetMinimum(min);
    this->SetMaximum(max);
  };

which fixed the other errors but now I have a new one which I do not know how 
to fix:
/spare1/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp: In member function 
‘void ChartWidget::refreshPlots()’:
/spare1/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:297:14: error: ‘class 
vtkAxis’ has no member named ‘GetRange’
/spare1/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:298:14: error: ‘class 
vtkAxis’ has no member named ‘GetRange’
/spare1/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:303:29: error: no 
matching function for call to ‘vtkAxis::SetRange(double [2])’
/spare1/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:303:29: note: candidate 
is:
/usr/include/vtk-5.8/vtkAxis.h:117:16: note: virtual void 
vtkAxis::SetRange(double, double)
/usr/include/vtk-5.8/vtkAxis.h:117:16: note:   candidate expects 2 arguments, 1 
provided
/spare1/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:305:31: error: no 
matching function for call to ‘vtkAxis::SetRange(double [2])’
/spare1/mfelis/temp/btkhg/Tools/Mokka/ChartWidget.cpp:305:31: note: candidate 
is:
/usr/include/vtk-5.8/vtkAxis.h:117:16: note: virtual void 
vtkAxis::SetRange(double, double)
/usr/include/vtk-5.8/vtkAxis.h:117:16: note:   candidate expects 2 arguments, 1 
provided
make[2]: *** [Tools/Mokka/CMakeFiles/Mokka.dir/ChartWidget.cpp.o] Error 1
make[1]: *** [Tools/Mokka/CMakeFiles/Mokka.dir/all] Error 2
make: *** [all] Error 2

Original comment by martin.f...@gmail.com on 8 Nov 2012 at 2:07

GoogleCodeExporter commented 8 years ago
Is it possible that the patch didn't work correctly?

The methods btk::VTKAxis::SetRange and btk::VTKAxis::GetRange are in the
proposed patch.

After applying the patch, they should be declared in btkVTKAxis.h (line
~80) and defined in the file btkVTKAxis.cpp (line ~505).

Original comment by arnaud.barre on 8 Nov 2012 at 2:12

GoogleCodeExporter commented 8 years ago
Yes the patch introduces the function VTKAxis::SetRange, however only taking a 
double array of length 2 and not the variant that takes two separate doubles.

Original comment by martin.f...@gmail.com on 9 Nov 2012 at 8:32

GoogleCodeExporter commented 8 years ago
The method SetRange(double, double) is already implemented in the class
vtkAxis with VTK 5.8 (
http://www.vtk.org/doc/release/5.8/html/a00197.html#b08b3a09494df12959043e516eb0
6549).

Did you have any warnings during the compilation? Like a shadow
declaration? Maybe a "using vtkAxis::SetRange;" is missing just before the
declaration of SetRange in the btkVTKAxis.h (line 81). Can you add it and
see if it works?

Original comment by arnaud.barre on 9 Nov 2012 at 9:56

GoogleCodeExporter commented 8 years ago
I do not have a warning about shadowed declarations. Also I am compiling 
everything in a new directory.

Line 81 int btkVTKAxis.h reads for me:
  virtual void SetRange(double range[2]);

Line 117 of vtkAxis.h that comes with the vtk-5.8 package lists the proper 
function declaration:
  virtual void SetRange(double minimum, double maximum);

It seems somehow that btk::VTKAxis does not properly inherit this function from 
vtkAxis.

Original comment by martin.f...@gmail.com on 12 Nov 2012 at 1:03