OctoMap / octomap

An Efficient Probabilistic 3D Mapping Framework Based on Octrees. Contains the main OctoMap library, the viewer octovis, and dynamicEDT3D.
http://octomap.github.io
1.94k stars 657 forks source link

Build octovis fails under windows10 (Qt linking) #381

Open CCHLENG opened 2 years ago

CCHLENG commented 2 years ago

windows10 x64 Qt 5.7 MinGW 5.3.0 32bit octomap 1.9.6

Build follow octovis/README.md. octovis is built successful. I can find QGLViewer2.dll, libQGLViewer2.a, QGLViewerd2.dll, libQGLViewerd2.a in octomap-1.9.6\octovis\src\extern\QGLViewer. But when i builing octomap, error code like following:

[ 73%] Built target unit_tests
[ 73%] Built target dynamicedt3d
Scanning dependencies of target exampleEDTOctomapStamped
Scanning dependencies of target exampleEDT3D
Scanning dependencies of target exampleEDTOctomap
[ 74%] Building CXX object dynamicEDT3D/src/examples/CMakeFiles/exampleEDT3D.dir/exampleEDT3D.cpp.obj
[ 75%] Building CXX object dynamicEDT3D/src/examples/CMakeFiles/exampleEDTOctomap.dir/exampleEDTOctomap.cpp.obj
[ 75%] Building CXX object dynamicEDT3D/src/examples/CMakeFiles/exampleEDTOctomapStamped.dir/exampleEDTOctomapStamped.cpp.obj
[ 76%] Linking CXX shared library ..\..\bin\liboctovis.dll
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text+0x108d): undefined reference to `_imp___ZN6QTimerD1Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text+0x10d0): undefined reference to `_imp___ZN7QObjectD2Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text+0x1113): undefined reference to `_imp___ZN6QTimerD1Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text+0x1156): undefined reference to `_imp___ZN7QObjectD2Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text$_ZN5QListIPN9qglviewer12MouseGrabberEE13detach_helperEi[__ZN5QListIPN9qglviewer12MouseGrabberEE13detach_helperEi]+0x1a): undefined reference to `_imp___ZN9QListData6detachEi'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text$_ZN5QListIPN9qglviewer12MouseGrabberEE13detach_helperEi[__ZN5QListIPN9qglviewer12MouseGrabberEE13detach_helperEi]+0x7b): undefined reference to `_imp___ZN9QListData7disposeEPNS_4DataE'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text$_ZN9qglviewer16ManipulatedFrameD0Ev[__ZN9qglviewer16ManipulatedFrameD0Ev]+0x3b): undefined reference to `_imp___ZN6QTimerD1Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text$_ZN9qglviewer16ManipulatedFrameD0Ev[__ZN9qglviewer16ManipulatedFrameD0Ev]+0x7e): undefined reference to `_imp___ZN7QObjectD2Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text$_ZThn72_N9qglviewer16ManipulatedFrameD0Ev[__ZThn72_N9qglviewer16ManipulatedFrameD0Ev]+0x3c): undefined reference to `_imp___ZN6QTimerD1Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.cpp:(.text$_ZThn72_N9qglviewer16ManipulatedFrameD0Ev[__ZThn72_N9qglviewer16ManipulatedFrameD0Ev]+0x7c): undefined reference to `_imp___ZN7QObjectD2Ev'
collect2.exe: error: ld returned 1 exit status
octovis\CMakeFiles\octovis-shared.dir\build.make:168: recipe for target '../bin/liboctovis.dll' failed
mingw32-make[2]: *** [../bin/liboctovis.dll] Error 1
CMakeFiles\Makefile2:1850: recipe for target 'octovis/CMakeFiles/octovis-shared.dir/all' failed
mingw32-make[1]: *** [octovis/CMakeFiles/octovis-shared.dir/all] Error 2
mingw32-make[1]: *** Waiting for unfinished jobs....
[ 77%] Linking CXX executable ..\..\..\..\bin\exampleEDT3D.exe
[ 77%] Built target exampleEDT3D
[ 78%] Linking CXX executable ..\..\..\..\bin\exampleEDTOctomap.exe
[ 79%] Linking CXX executable ..\..\..\..\bin\exampleEDTOctomapStamped.exe
[ 79%] Built target exampleEDTOctomap
[ 79%] Built target exampleEDTOctomapStamped
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

It looks like QTimer and QObject in SelectionBox.cpp can't be found, what should i do? thanks.

mini-batch commented 5 months ago

Did you ever find a solution to this? I am having a very similar error when building both the libraries.

windows11 x64 Qt 5.14 MinGW 7.3.0 64-bit octomap v1.10.0

[ 54%] Built target test_mapcollection
[ 56%] Built target test_pruning
[ 58%] Built target test_bbx
[ 60%] Built target unit_tests
[ 65%] Built target octovis-static
[ 66%] Linking CXX shared library ..\..\bin\liboctovis.dll
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text+0x1288): undefined reference to `__imp__ZN6QTimerD1Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text+0x12be): undefined reference to `__imp__ZN7QObjectD2Ev
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text+0x1314): undefined reference to `__imp__ZN6QTimerD1Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text+0x134a): undefined reference to `__imp__ZN7QObjectD2Ev
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text$_ZN5QListIPN9qglviewer12MouseGrabberEE13detach_helperEi[_ZN5QListIPN9qglviewer12MouseGrabberEE13detach_helperEi]+0x1b): undefined reference to `__imp__ZN9QListData6detachEi'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text$_ZN5QListIPN9qglviewer12MouseGrabberEE13detach_helperEi[_ZN5QListIPN9qglviewer12MouseGrabberEE13detach_helperEi]+0x7d): undefined reference to `__imp__ZN9QListData7disposeEPNS_4DataE'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text$_ZN9qglviewer16ManipulatedFrameD0Ev[_ZN9qglviewer16ManipulatedFrameD0Ev]+0x2d): undefined reference to `__imp__ZN6QTimerD1Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text$_ZN9qglviewer16ManipulatedFrameD0Ev[_ZN9qglviewer16ManipulatedFrameD0Ev]+0x63): undefined reference to `__imp__ZN7QObjectD2Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text$_ZThn88_N9qglviewer16ManipulatedFrameD0Ev[_ZThn88_N9qglviewer16ManipulatedFrameD0Ev]+0x2e): undefined reference to `__imp__ZN6QTimerD1Ev'
CMakeFiles\octovis-shared.dir/objects.a(SelectionBox.cpp.obj):SelectionBox.c:(.text$_ZThn88_N9qglviewer16ManipulatedFrameD0Ev[_ZThn88_N9qglviewer16ManipulatedFrameD0Ev]+0x63): undefined reference to `__imp__ZN7QObjectD2Ev'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [octovis\CMakeFiles\octovis-shared.dir\build.make:187: ../../bin/liboctovis.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:1807: octovis/CMakeFiles/octovis-shared.dir/all] Error 2
mingw32-make: *** [Makefile:165: all] Error 2