google-code-export / 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 9 years ago

GoogleCodeExporter commented 9 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 9 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 9 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 9 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 9 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 9 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 9 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 9 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 9 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

GoogleCodeExporter commented 9 years ago
I downloaded VTK 5.8 and found the problem.

So first, GCC gave me a warning about the hidden method vtkAxis::SetRange. 
Adding the method "using vtkAxis::SetRange" fixed the warning. However, new 
errors happended in the method ChartWidget::refreshPlots. Using the code 
'btk::VTKAxis* axisX = 
btk::VTKAxis::SafeDownCast(chart->GetAxis(vtkAxis::BOTTOM));' and 
'btk::VTKAxis* axisY = 
btk::VTKAxis::SafeDownCast(chart->GetAxis(vtkAxis::LEFT));' in the line 297 and 
299 of the file CharWidget.cpp fixes the issue.

Note: I have large modifications in the file CharWidget.cpp, so I cannot yet 
create a patch for this issue.

Original comment by arnaud.barre on 12 Nov 2012 at 7:29

GoogleCodeExporter commented 9 years ago
The revision r1365 should fix this issue. Can you try and tell me if it works?

Original comment by arnaud.barre on 19 Nov 2012 at 12:10

GoogleCodeExporter commented 9 years ago
Note: Due to the revision r1364, the code doesn't compile under Windows or 
Linux as the preferences for the cycles are not implemented for these OS. This 
will be fixed soon.

Original comment by arnaud.barre on 19 Nov 2012 at 12:29

GoogleCodeExporter commented 9 years ago
As of r1365 the file ChartWidget.cpp does compile but the file 
Tools/Mokka/CMakeFiles/Mokka.dir/MainWindow.cpp does not (probably due to the 
issues you mentioned).

Original comment by martin.f...@gmail.com on 19 Nov 2012 at 1:15

GoogleCodeExporter commented 9 years ago
The revision r1371 should close totally this issue. Can you test it and report 
me if the compilation is fine?

Original comment by arnaud.barre on 21 Nov 2012 at 7:52

GoogleCodeExporter commented 9 years ago
Works! Awesome!

Thanks a lot!

Original comment by martin.f...@gmail.com on 21 Nov 2012 at 5:19

GoogleCodeExporter commented 9 years ago
Issue fixed mainly by the revision r1365, but some code is also in revisions 
r1364 and r1371

Original comment by arnaud.barre on 22 Nov 2012 at 5:36