koba / overhead-camera-people-counter

People counting algorithm using an overhead video camera
GNU General Public License v3.0
65 stars 21 forks source link

compile error #1

Closed nickwwww closed 6 years ago

nickwwww commented 6 years ago

Hello agurz,

I clone your code and compile on ubuntu16.0.4, it always report errors. Do you know how to resolve this error? thanks for your kindly help!

elf@elf-shadow:~/wjx/workspace/code/counter/overhead-camera-people-counter/build$ ll total 44 drwxrwxr-x 3 elf elf 4096 12月 1 10:55 ./ drwxrwxr-x 7 elf elf 4096 12月 1 10:55 ../ -rw-rw-r-- 1 elf elf 19637 12月 1 10:55 CMakeCache.txt drwxrwxr-x 6 elf elf 4096 12月 1 11:02 CMakeFiles/ -rw-rw-r-- 1 elf elf 1451 12月 1 10:55 cmake_install.cmake -rw-rw-r-- 1 elf elf 5150 12月 1 10:55 Makefile elf@elf-shadow:~/wjx/workspace/code/counter/overhead-camera-people-counter/build$ make [ 50%] Building CXX object CMakeFiles/people-counter.dir/src/main.cpp.o In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/string:41, from /usr/include/c++/5/bits/locale_classes.h:40, from /usr/include/c++/5/bits/ios_base.h:41, from /usr/include/c++/5/ios:42, from /usr/include/c++/5/ostream:38, from /usr/include/c++/5/iostream:39, from /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/help.cpp:1, from /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/main.cpp:1: /usr/include/c++/5/ext/new_allocator.h: In instantiation of ‘struct gnu_cxx::new_allocator’: /usr/include/c++/5/bits/allocator.h:92:11: required from ‘class std::allocator’ /usr/include/c++/5/bits/stl_vector.h:79:14: required from ‘struct std::_Vector_base<const Line, std::allocator >::_Vector_impl’ /usr/include/c++/5/bits/stl_vector.h:164:20: required from ‘struct std::_Vector_base<const Line, std::allocator >’ /usr/include/c++/5/bits/stl_vector.h:214:11: required from ‘class std::vector’ /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/modules/counter/VideoCapturePeopleCounter.cpp:119:57: required from here /usr/include/c++/5/ext/new_allocator.h:93:7: error: ‘const _Tp* __gnu_cxx::new_allocator<_Tp>::address(gnu_cxx::new_allocator<_Tp>::const_reference) const [with _Tp = const Line; gnu_cxx::new_allocator<_Tp>::const_pointer = const Line*; gnu_cxx::new_allocator<_Tp>::const_reference = const Line&]’ cannot be overloaded address(const_reference x) const _GLIBCXX_NOEXCEPT ^ /usr/include/c++/5/ext/new_allocator.h:89:7: error: with ‘_Tp* gnu_cxx::new_allocator<_Tp>::address(gnu_cxx::new_allocator<_Tp>::reference) const [with _Tp = const Line; gnu_cxx::new_allocator<_Tp>::pointer = const Line; gnu_cxx::new_allocator<_Tp>::reference = const Line&]’ address(reference __x) const _GLIBCXX_NOEXCEPT ^ /usr/include/c++/5/ext/new_allocator.h: In instantiation of ‘void gnu_cxx::new_allocator<_Tp>::deallocate(gnu_cxx::new_allocator<_Tp>::pointer, __gnu_cxx::new_allocator<_Tp>::size_type) [with _Tp = const Line; gnu_cxx::new_allocator<_Tp>::pointer = const Line; gnu_cxx::new_allocator<_Tp>::size_type = long unsigned int]’: /usr/include/c++/5/bits/alloc_traits.h:517:9: required from ‘static void std::allocator_traits<std::allocator<_CharT> >::deallocate(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, std::allocator_traits<std::allocator<_CharT> >::pointer, std::allocator_traits<std::allocator<_CharT> >::size_type) [with _Tp = const Line; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator; std::allocator_traits<std::allocator<_CharT> >::pointer = const Line; std::allocator_traits<std::allocator<_CharT> >::size_type = long unsigned int]’ /usr/include/c++/5/bits/stl_vector.h:178:19: required from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(std::_Vector_base<_Tp, _Alloc>::pointer, std::size_t) [with _Tp = const Line; _Alloc = std::allocator; std::_Vector_base<_Tp, _Alloc>::pointer = const Line; std::size_t = long unsigned int]’ /usr/include/c++/5/bits/vector.tcc:433:19: required from ‘void std::vector<_Tp, _Alloc>::_M_emplace_back_aux(_Args&& ...) [with _Args = {const Line&}; _Tp = const Line; _Alloc = std::allocator]’ /usr/include/c++/5/bits/stl_vector.h:923:23: required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = const Line; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::value_type = const Line]’ /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/modules/counter/VideoCapturePeopleCounter.cpp:132:64: required from here /usr/include/c++/5/ext/new_allocator.h:110:26: error: invalid conversion from ‘const void’ to ‘void’ [-fpermissive] { ::operator delete(p); } ^ In file included from /usr/include/c++/5/ext/new_allocator.h:33:0, from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33, from /usr/include/c++/5/bits/allocator.h:46, from /usr/include/c++/5/string:41, from /usr/include/c++/5/bits/locale_classes.h:40, from /usr/include/c++/5/bits/ios_base.h:41, from /usr/include/c++/5/ios:42, from /usr/include/c++/5/ostream:38, from /usr/include/c++/5/iostream:39, from /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/help.cpp:1, from /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/main.cpp:1: /usr/include/c++/5/new:115:6: note: initializing argument 1 of ‘void operator delete(void)’ void operator delete(void) _GLIBCXX_USE_NOEXCEPT ^ In file included from /usr/include/c++/5/bits/stl_tempbuf.h:60:0, from /usr/include/c++/5/bits/stl_algo.h:62, from /usr/include/c++/5/algorithm:62, from /usr/local/include/opencv2/core/base.hpp:55, from /usr/local/include/opencv2/core.hpp:54, from /usr/local/include/opencv2/opencv.hpp:52, from /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/modules/model/Line.cpp:1, from /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/modules/model.hpp:6, from /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/modules/counter.hpp:4, from /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/main.cpp:2: /usr/include/c++/5/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1, _Args&& ...) [with _T1 = const Line; _Args = {const Line&}]’: /usr/include/c++/5/bits/stl_uninitialized.h:75:18: required from ‘static _ForwardIterator std::uninitialized_copy<_TrivialValueTypes>::uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const Line; _ForwardIterator = const Line; bool _TrivialValueTypes = false]’ /usr/include/c++/5/bits/stl_uninitialized.h:126:15: required from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = const Line; _ForwardIterator = const Line]’ /usr/include/c++/5/bits/stl_uninitialized.h:281:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = const Line; _ForwardIterator = const Line; _Tp = const Line]’ /usr/include/c++/5/bits/stl_uninitialized.h:303:2: required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = const Line; _ForwardIterator = const Line; _Allocator = std::allocator]’ /usr/include/c++/5/bits/vector.tcc:422:8: required from ‘void std::vector<_Tp, _Alloc>::_M_emplace_back_aux(_Args&& ...) [with _Args = {const Line&}; _Tp = const Line; _Alloc = std::allocator]’ /usr/include/c++/5/bits/stl_vector.h:923:23: required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = const Line; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::value_type = const Line]’ /home/elf/wjx/workspace/code/counter/overhead-camera-people-counter/src/modules/counter/VideoCapturePeopleCounter.cpp:132:64: required from here /usr/include/c++/5/bits/stl_construct.h:75:7: error: invalid static_cast from type ‘const Line’ to type ‘void’ { ::new(static_cast<void>(p)) _T1(std::forward<_Args>(args)...); } ^ CMakeFiles/people-counter.dir/build.make:62: recipe for target 'CMakeFiles/people-counter.dir/src/main.cpp.o' failed

agurod42 commented 6 years ago

Hey @nickwwww, thanks for reporting this. I'll take a look at this next week.

nickwwww commented 6 years ago

@agurz ,thanks for your reply, hope your reply message.

agurod42 commented 6 years ago

Hey @nickwwww, sorry for delay, I was busy with work and exams.

I was able to reproduce the error on a fresh Ubuntu 16.04 installation. I just fixed it, please let me know if it works for you.