CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.87k stars 1.38k forks source link

Compilation error with recent libQGLViewer>=2.6.0 #138

Closed lrineau closed 9 years ago

lrineau commented 9 years ago

After a discussion on the CGAL-develop mailing list, where I asked developers to try the RC of CGAL-4.6.1...

A compilation error in demo/Mesh_3/ with g++ 5.1.0:

Friday 26 June 2015 15:24:56 Alexander Kobel wrote :
> ========================================================================
> == Arch up-to-date, x86_64 (in chroot of the above Debian), g++ 5.1.0
> == RS3 manually installed, everything else from the repos
> == -DWITH_{GMPXX,MPFI,RS,RS3,NTL,demos,examples}=On
> == Compiled all but one from demos and all examples successfully,
> == except those requiring ESBTL, OpenMesh, and/or Qt3.
> ========================================================================
> .../demo/Mesh_3/Volume_planes_plugin.cpp: In member function ‘void
> Plane_slider::updateValue()’:
> .../demo/Mesh_3/Volume_planes_plugin.cpp:120:31: error:invalid
> initialization of non-const reference of type ‘qreal& {aka double&}’
> from an rvalue of type ‘qreal {aka double}’
>       frame->getPosition(a, b, c);
>                                 ^
> 
> In file included from /usr/include/QGLViewer/keyFrameInterpolator.h:31:0,
>                   from /usr/include/QGLViewer/camera.h:26,
>                   from /usr/include/QGLViewer/qglviewer.h:26,
>                   from
> /home/akobel/CGAL-4.6.1/demo/Mesh_3/Volume_plane.h:15,
>                   from
> /home/akobel/CGAL-4.6.1/demo/Mesh_3/Volume_planes_plugin.cpp:5:
> /usr/include/QGLViewer/frame.h:188:7: note:   initializing argument 1 of
> ‘void qglviewer::Frame::getPosition(qreal&, qreal&, qreal&) const’
>    void getPosition(qreal& x, qreal& y, qreal& z) const;
>         ^

and also the same compilation bug with clang++ 3.6.1:

> ========================================================================
> == Arch up-to-date, x86_64 (in chroot of Debian), clang++ 3.6.1
> == RS3 manually installed, everything else from the repos
> == -DWITH_{GMPXX,MPFI,RS,RS3,NTL,demos,examples}=On
> == -DCMAKE_BUILD_TYPE=Debug
> == Compiled all but one from demos and all examples successfully,
> == except those requiring ESBTL, OpenMesh, and/or Qt3.
> ========================================================================
> /home/akobel/CGAL-4.6.1/demo/Mesh_3/Volume_planes_plugin.cpp:120:24: error:
>        non-const lvalue reference to type 'qreal' (aka 'double') cannot
> bind to a value
>        of unrelated type 'float'
>      frame->getPosition(a, b, c);
>                         ^
> /usr/include/QGLViewer/frame.h:188:26: note: passing argument to
> parameter 'x' here
>          void getPosition(qreal& x, qreal& y, qreal& z) const;
>                                  ^
lrineau commented 9 years ago

The culprit is https://github.com/GillesDebunne/libQGLViewer/commit/4ad89e3b2bf57a5483f0ac557ff6b6636705085c

TungTNguyen commented 7 years ago

@lrineau : I got stuck in the same issue, and changed the float type to qreal as suggested by an user on Stack Over Flow. You are the second who suggest that. But the issue persists. Another user on Git Hub told me that it's because of the version mismatch between C++ and lib qgl viewer. What's your opinion? Thanks in advance.

lrineau commented 7 years ago

@TungTNguyen I think you should open a new issue, with a precise description of your compilation issues:

Nobody can debug any compilation errors without all that information.

If the code you compile is related to CGAL, you can open the issue in the CGAL issue tracker, otherwise please us the issue tracker of QGLViewer.