Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

computeBound function return type error #1

Open
spaghetti- opened this issue Feb 3, 2016 · 4 comments
Open

computeBound function return type error #1

spaghetti- opened this issue Feb 3, 2016 · 4 comments

Comments

@spaghetti-
Copy link

Hello, I'm with osg 3.4 and I'm getting this error on compilation

In file included from /opt/uwsim/src/uwsim_osgocean/src/osgOcean/MipmapGeometryVBO.cpp:18:
/opt/uwsim/src/uwsim_osgocean/include/osgOcean/MipmapGeometryVBO:147:26: error: virtual function 'computeBound' has a different return type ('osg::BoundingBox' (aka 'BoundingBoxImpl<osg::Vec3f>')) than
      the function it overrides (which has return type 'BoundingSphere' (aka 'BoundingSphereImpl<osg::Vec3f>'))
        osg::BoundingBox computeBound( void ) const;
        ~~~~~~~~~~~~~~~~ ^
/usr/local/include/osg/Drawable:160:32: note: overridden virtual function is here
        virtual BoundingSphere computeBound() const;
                ~~~~~~~~~~~~~~ ^

It seems that the API has changed: xarray/osgRecipes#13

I'll submit a PR if I manage to get around this issue. I'm on the indigo-devel branch.

@1ADZX
Copy link

1ADZX commented Jun 5, 2020

Hello, I'm with osg 3.4 and I'm getting this error on compilation

In file included from /opt/uwsim/src/uwsim_osgocean/src/osgOcean/MipmapGeometryVBO.cpp:18:
/opt/uwsim/src/uwsim_osgocean/include/osgOcean/MipmapGeometryVBO:147:26: error: virtual function 'computeBound' has a different return type ('osg::BoundingBox' (aka 'BoundingBoxImpl<osg::Vec3f>')) than
      the function it overrides (which has return type 'BoundingSphere' (aka 'BoundingSphereImpl<osg::Vec3f>'))
        osg::BoundingBox computeBound( void ) const;
        ~~~~~~~~~~~~~~~~ ^
/usr/local/include/osg/Drawable:160:32: note: overridden virtual function is here
        virtual BoundingSphere computeBound() const;
                ~~~~~~~~~~~~~~ ^

It seems that the API has changed: xarray/osgRecipes#13

I'll submit a PR if I manage to get around this issue. I'm on the indigo-devel branch.

Hello, I have the same problem as you. Can you tell me how to solve it? I don't know where to use OSG_ VERSION_ Greeter macro, thank you

@1ADZX
Copy link

1ADZX commented Jun 5, 2020

This is my compile error message

In file included from /home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/FFTOceanSurfaceVBO:21:0,
from /home/dzx/sonar_simulation/gui/osg_ocean/src/osgOcean/FFTOceanSurfaceVBO.cpp:18:
/home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/MipmapGeometryVBO:147:26: error: invalid covariant return type for ‘virtual osg::BoundingBox osgOcean::MipmapGeometryVBO::computeBound() const’
osg::BoundingBox computeBound( void ) const;
^
In file included from /usr/local/include/osg/Geode:18:0,
from /home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/OceanTechnique:20,
from /home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/FFTOceanTechnique:20,
from /home/dzx/sonar_simulation/gui/osg_ocean/include/osgOcean/FFTOceanSurfaceVBO:20,
from /home/dzx/sonar_simulation/gui/osg_ocean/src/osgOcean/FFTOceanSurfaceVBO.cpp:18:
/usr/local/include/osg/Drawable:155:32: error: overriding ‘virtual osg::BoundingSphere osg::Drawable::computeBound() const’
virtual BoundingSphere computeBound() const;
^
src/osgOcean/CMakeFiles/osgOcean.dir/build.make:158: recipe for target 'src/osgOcean/CMakeFiles/osgOcean.dir/FFTOceanSurfaceVBO.cpp.o' failed

@JIbald
Copy link

JIbald commented Nov 11, 2020

Hello, did any of you find a solution to this?
My code compiled, when I tried to return a BoundingBox from within the function body, but in the head wrote osg::BoundingSphere as return type.
Yet this made me run into the next error:

/usr/bin/ld: CMakeFiles/MyProject.dir/main.cpp.o: undefined reference to symbol 'glFrontFace'
/usr/bin/ld: /lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/MyProject.dir/build.make:108: MyProject] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/MyProject.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

Anybody know a solution to this?

@luis-robotic
Copy link

Hello, I am facing the same issue. Anyone has fixed it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants