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

link error with undefined reference in ubuntu20.04 #1669

Open
wumin199 opened this issue Jun 17, 2022 · 0 comments
Open

link error with undefined reference in ubuntu20.04 #1669

wumin199 opened this issue Jun 17, 2022 · 0 comments
Labels
type: bug Indicates an unexpected problem or unintended behavior

Comments

@wumin199
Copy link

Bug Report

I clone source code to my computer then conduct:

mkdir build && cd build
cmake ..
make  -j8

the output is always like this:

[ 98%] Building CXX object dart/gui/osg/CMakeFiles/dart-gui-osg.dir/render/ShapeNode.cpp.o
[ 98%] Building CXX object dart/gui/osg/CMakeFiles/dart-gui-osg.dir/render/SoftMeshShapeNode.cpp.o
[ 98%] Building CXX object dart/gui/osg/CMakeFiles/dart-gui-osg.dir/render/SphereShapeNode.cpp.o
[ 98%] Building CXX object dart/gui/osg/CMakeFiles/dart-gui-osg.dir/render/VoxelGridShapeNode.cpp.o
[100%] Building CXX object dart/gui/osg/CMakeFiles/dart-gui-osg.dir/render/WarningShapeNode.cpp.o
[100%] Linking CXX shared library ../../../lib/libdart-gui-osg.so
/usr/bin/ld: CMakeFiles/dart-gui-osg.dir/DefaultEventHandler.cpp.o: in function `osg::Drawable::EventCallback::cloneType() const':
DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback9cloneTypeEv[_ZNK3osg8Drawable13EventCallback9cloneTypeEv]+0x37): undefined reference to `VTT for osg::Drawable::EventCallback'
/usr/bin/ld: DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback9cloneTypeEv[_ZNK3osg8Drawable13EventCallback9cloneTypeEv]+0x62): undefined reference to `vtable for osg::Drawable::EventCallback'
/usr/bin/ld: CMakeFiles/dart-gui-osg.dir/DefaultEventHandler.cpp.o: in function `virtual thunk to osg::Drawable::EventCallback::cloneType() const':
DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback9cloneTypeEv[_ZNK3osg8Drawable13EventCallback9cloneTypeEv]+0xf7): undefined reference to `VTT for osg::Drawable::EventCallback'
/usr/bin/ld: DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback9cloneTypeEv[_ZNK3osg8Drawable13EventCallback9cloneTypeEv]+0x122): undefined reference to `vtable for osg::Drawable::EventCallback'
/usr/bin/ld: CMakeFiles/dart-gui-osg.dir/DefaultEventHandler.cpp.o: in function `virtual thunk to osg::Drawable::EventCallback::cloneType() const':
DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback9cloneTypeEv[_ZNK3osg8Drawable13EventCallback9cloneTypeEv]+0x1b7): undefined reference to `VTT for osg::Drawable::EventCallback'
/usr/bin/ld: DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback9cloneTypeEv[_ZNK3osg8Drawable13EventCallback9cloneTypeEv]+0x1e2): undefined reference to `vtable for osg::Drawable::EventCallback'
/usr/bin/ld: CMakeFiles/dart-gui-osg.dir/DefaultEventHandler.cpp.o: in function `osg::Drawable::EventCallback::isSameKindAs(osg::Object const*) const':
DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback12isSameKindAsEPKNS_6ObjectE[_ZNK3osg8Drawable13EventCallback12isSameKindAsEPKNS_6ObjectE]+0x13): undefined reference to `typeinfo for osg::Drawable::EventCallback'
/usr/bin/ld: CMakeFiles/dart-gui-osg.dir/DefaultEventHandler.cpp.o: in function `virtual thunk to osg::Drawable::EventCallback::isSameKindAs(osg::Object const*) const':
DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback12isSameKindAsEPKNS_6ObjectE[_ZNK3osg8Drawable13EventCallback12isSameKindAsEPKNS_6ObjectE]+0x53): undefined reference to `typeinfo for osg::Drawable::EventCallback'
/usr/bin/ld: CMakeFiles/dart-gui-osg.dir/DefaultEventHandler.cpp.o: in function `virtual thunk to osg::Drawable::EventCallback::isSameKindAs(osg::Object const*) const':
DefaultEventHandler.cpp:(.text._ZNK3osg8Drawable13EventCallback12isSameKindAsEPKNS_6ObjectE[_ZNK3osg8Drawable13EventCallback12isSameKindAsEPKNS_6ObjectE]+0x93): undefined reference to `typeinfo for osg::Drawable::EventCallback'
/usr/bin/ld: CMakeFiles/dart-gui-osg.dir/DefaultEventHandler.cpp.o: in function `osg::Drawable::EventCallback::clone(osg::CopyOp const&) const':

....

/usr/bin/ld: CMakeFiles/dart-gui-osg.dir/render/VoxelGridShapeNode.cpp.o: in function `dart::gui::osg::render::VoxelGridShapeNode::extractData(bool)':
VoxelGridShapeNode.cpp:(.text+0xbc0): undefined reference to `osg::Drawable::dirtyDisplayList()'
collect2: error: ld returned 1 exit status
make[2]: *** [dart/gui/osg/CMakeFiles/dart-gui-osg.dir/build.make:564: lib/libdart-gui-osg.so.6.13.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:2993: dart/gui/osg/CMakeFiles/dart-gui-osg.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

It seems that something wrong with libdart-gui-osg.so

And there is no libdart-gui-osg in my computer as locate libdart-gui-osg return nothing.

Environment

Select the following information.

  • DART version: master, 6.12.1
  • Ubuntu20.04
  • Compiler name and version number: gcc 9.4.0

Expected Behavior

Please describe the behavior you are expecting.
make successfuly

@wumin199 wumin199 added the type: bug Indicates an unexpected problem or unintended behavior label Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant