Unable to compile this module
Hi, I just update the latest version of DV-runtime. dv-gui and dv-runtime-dev.
dv-runtime-dev is already the newest version (1.4.6.1-2~bionic).
dv-runtime is already the newest version (1.4.6.1-2~bionic).
dv-gui is already the newest version (1.4.6-1~bionic).
But all my previous written and tested modules are unable to compile, I test the official dv-example-cpp, and meet the same errors as follow:
[ 50%] Building CXX object CMakeFiles/example.dir/ExampleModule.cpp.o
In file included from /usr/include/dv-sdk/config.hpp:5:0,
from /usr/include/dv-sdk/module_base.hpp:4,
from /usr/include/dv-sdk/module.hpp:4,
from /home/eleboss/Documents/dv-example-cpp/ExampleModule.cpp:1:
/usr/include/dv-sdk/utils.h:97:80: error: ‘std::function’ has not been declared
inline std::shared_ptr<T> shared_ptr_wrap_extra_deleter(std::shared_ptr<T> in, std::function<void(T *)> action) {
^~~
/usr/include/dv-sdk/utils.h:97:93: error: expected ‘,’ or ‘...’ before ‘<’ token
inline std::shared_ptr<T> shared_ptr_wrap_extra_deleter(std::shared_ptr<T> in, std::function<void(T *)> action) {
^
/usr/include/dv-sdk/utils.h: In function ‘std::shared_ptr<_Tp> dv::shared_ptr_wrap_extra_deleter(std::shared_ptr<_Tp>, int)’:
/usr/include/dv-sdk/utils.h:101:7: error: ‘action’ was not declared in this scope
if (!action) {
^~~~~~
/usr/include/dv-sdk/utils.h:101:7: note: suggested alternative: ‘ctime’
if (!action) {
^~~~~~
ctime
/usr/include/dv-sdk/utils.h:105:22: error: ‘action’ was not declared in this scope
auto new_deleter = [action](std::shared_ptr<T> *p) {
^~~~~~
/usr/include/dv-sdk/utils.h:105:22: note: suggested alternative: ‘ctime’
auto new_deleter = [action](std::shared_ptr<T> *p) {
^~~~~~
ctime
/usr/include/dv-sdk/utils.h: In lambda function:
/usr/include/dv-sdk/utils.h:106:3: error: ‘action’ is not captured
action(p->get());
^~~~~~
/usr/include/dv-sdk/utils.h:105:28: note: the lambda has no capture-default
auto new_deleter = [action](std::shared_ptr<T> *p) {
^
/usr/include/dv-sdk/utils.h:105:22: note: ‘<typeprefixerror>action’ declared here
auto new_deleter = [action](std::shared_ptr<T> *p) {
^~~~~~
/usr/local/include/opencv2/core/matx.hpp: In instantiation of ‘class cv::Matx<double, 4, 4>’:
/usr/local/include/opencv2/core/types.hpp:2333:47: required from here
cc1plus: warning: this condition has identical branches [-Wduplicated-branches]
CMakeFiles/example.dir/build.make:62: recipe for target 'CMakeFiles/example.dir/ExampleModule.cpp.o' failed
make[2]: *** [CMakeFiles/example.dir/ExampleModule.cpp.o] Error 1
CMakeFiles/Makefile2:75: recipe for target 'CMakeFiles/example.dir/all' failed
make[1]: *** [CMakeFiles/example.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
This is the cmake output for reference:
-- Project name is: dv-example-cpp
-- Project version is: 1.0.0
-- Build type is: Release
-- Compiler is Clang: FALSE
-- Compiler is GCC: TRUE
-- Compiler is IntelCC: FALSE
-- Compiler is MS VisualC: FALSE
-- OS is Unix: TRUE
-- OS is Linux: TRUE
-- OS is MacOS X: FALSE
-- OS is Windows: FALSE
-- System is big-endian: 0
-- Thread support is PThreads: TRUE
-- Thread support is Win32 Threads: FALSE
-- Thread support libraries: -lpthread
-- C flags are: -pedantic -Wall -Wextra -Wunused -Wundef -Wformat=2 -Wuninitialized -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wmissing-declarations -Wdouble-promotion -Wshadow -Wconversion -Wstrict-overflow=5 -Wlogical-op -Wduplicated-cond -Wduplicated-branches -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wjump-misses-init
-- CXX flags are: -pedantic -Wall -Wextra -Wunused -Wundef -Wformat=2 -Wuninitialized -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wmissing-declarations -Wdouble-promotion -Wshadow -Wconversion -Wstrict-overflow=5 -Wlogical-op -Wduplicated-cond -Wduplicated-branches -Wold-style-cast -Wzero-as-null-pointer-constant
-- Final install bindir is: /usr/bin
-- Final install libdir is: /usr/lib/x86_64-linux-gnu
-- Final install includedir is: /usr/include
-- Final local prefix is: /usr
CMake Warning at /usr/share/cmake-3.16/Modules/FindBoost.cmake:1161 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindBoost.cmake:1283 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.16/Modules/FindBoost.cmake:1921 (_Boost_MISSING_DEPENDENCIES)
/usr/share/dv/dv-modules.cmake:76 (FIND_PACKAGE)
CMakeLists.txt:41 (DV_MODULE_SETUP)
-- Base libraries: dv::dvsdk;fmt::fmt;Boost::boost;Boost::filesystem;opencv_core;opencv_imgproc
-- Final modules installation directory is: /usr/share/dv/modules
-- Configuring done
-- Generating done
-- Build files have been written to: /home/eleboss/Documents/dv-example-cpp
Any idea how to fix this? Best