Open eezstreet opened 5 years ago
float f[params.frameSize.width*params.frameSize.height]; is it really C++ https://en.cppreference.com/w/cpp/language/array ?
I also have the problem with
Severity Code Description Project File Line Suppression State Error C2131 expression did not evaluate to a constant opencv_rgbd
[234] - float f[params.frameSize.width*params.frameSize.height];
[235] - float pixels[params.frameSize.width*params.frameSize.height][3];
I also have the same problem. Error C2131 expression did not evaluate to a constant opencv_rgbd
If you don't need the RGB-Depth Processing module (that's where the error occurs) and just want to compile opencv on windows, just deactivate the extra module with -DBUILD_opencv_rgbd=OFF
during cmake-configure and you are good to go.
Problem is not easy to solve. You can use vector
1>dynafu.obj : error LNK2019: unresolved external symbol glBindRenderbufferEXT referenced in function "public: cdecl cv::dynafu::DynaFuImpl
This module is not compatible with windows and msvc. It is not available in 3.4 branch
I have encountered what seems to be a related problem, when compiling under Linux.
When OPENCV_ENABLE_NONFREE is set, and OpenGL_GL_PREFERENCE is set to GLVND (newer OpenGL), the build fails, with reference to libopencv_rgbd:
../../lib/libopencv_rgbd.so.4.2.0: undefined reference to `glRenderbufferStorageEXT' etc...
But if OpenGL_GL_PREFERENCE is set to LEGACY, there is no error.
Also have the problem:dynafu.cpp:181:26: error: 'glGenRenderbuffersEXT' was not declared in this scope glGenRenderbuffersEXT(1, &fbo_depth);
Reopening... Fix #2679 handles Windows case only, we need similar approach for Linux platform too.
Just adding the 'diff' from GArik's pull to my 4.4.0 release build appears to have fixed the issue on my Jetson nano (running linux).
Confirmed building on Ubuntu 22.04, patch by @GArik works fine
Trying to build OpenCV-4.7.0 and met this same issue.
It looks patch by @GArik works okay for this specific problem. However, I still cannot figure out this issue ...
If you don't need the RGB-Depth Processing module (that's where the error occurs) and just want to compile opencv on windows, just deactivate the extra module with
-DBUILD_opencv_rgbd=OFF
during cmake-configure and you are good to go.
As you said, I solved this issue by Turn OFF rgbd. Thank you ...
The GLVND build seems to be broken again after 4.6.0 in dynafu.cpp
.
IIRC 4.5.5 works.
Change Dir: '/tmp/scratch/opencv/build'
Run Build Command(s): /usr/bin/ninja -v
[1/3] : && /usr/bin/g++-12 -fPIC -fdebug-prefix-map='/tmp/scratch'='/usr/local/src' -g -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -flto=auto -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG -DNDEBUG -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libopencv_rgbd.so.410 -o lib/libopencv_rgbd.so.4.10.0 modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_cleaner.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_registration.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_to_3d.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dqb.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/fast_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/hash_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu_frame.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/large_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/linemod.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/nonrigid_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/normal.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/odometry.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/plane.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/pose_graph.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf_functions.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/utils.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/volume.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/warpfield.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/opencl_kernels_rgbd.cpp.o -Wl,-rpath,/tmp/scratch/opencv/build/lib:::::::::::::::::::::::::::: lib/libopencv_calib3d.so.4.10.0 -ldl -lm -lpthread -lrt 3rdparty/lib/libippiw.a 3rdparty/ippicv/ippicv_lnx/icv/lib/intel64/libippicv.a /usr/lib/x86_64-linux-gnu/libOpenGL.so /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libGLU.so lib/libopencv_features2d.so.4.10.0 lib/libopencv_flann.so.4.10.0 lib/libopencv_imgproc.so.4.10.0 lib/libopencv_core.so.4.10.0 && :
FAILED: lib/libopencv_rgbd.so.4.10.0
: && /usr/bin/g++-12 -fPIC -fdebug-prefix-map='/tmp/scratch'='/usr/local/src' -g -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -flto=auto -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG -DNDEBUG -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libopencv_rgbd.so.410 -o lib/libopencv_rgbd.so.4.10.0 modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/colored_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_cleaner.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_registration.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/depth_to_3d.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dqb.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/dynafu_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/fast_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/hash_tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/kinfu_frame.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/large_kinfu.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/linemod.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/nonrigid_icp.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/normal.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/odometry.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/plane.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/pose_graph.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/tsdf_functions.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/utils.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/volume.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/warpfield.cpp.o modules/rgbd/CMakeFiles/opencv_rgbd.dir/opencl_kernels_rgbd.cpp.o -Wl,-rpath,/tmp/scratch/opencv/build/lib:::::::::::::::::::::::::::: lib/libopencv_calib3d.so.4.10.0 -ldl -lm -lpthread -lrt 3rdparty/lib/libippiw.a 3rdparty/ippicv/ippicv_lnx/icv/lib/intel64/libippicv.a /usr/lib/x86_64-linux-gnu/libOpenGL.so /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libGLU.so lib/libopencv_features2d.so.4.10.0 lib/libopencv_flann.so.4.10.0 lib/libopencv_imgproc.so.4.10.0 lib/libopencv_core.so.4.10.0 && :
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o: in function `cv::dynafu::DynaFu::create(cv::Ptr<cv::kinfu::Params> const&)':
/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:159: undefined reference to `glGenRenderbuffersEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:160: undefined reference to `glBindRenderbufferEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:161: undefined reference to `glRenderbufferStorageEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:164: undefined reference to `glGenFramebuffersEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:165: undefined reference to `glBindFramebufferEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:167: undefined reference to `glFramebufferRenderbufferEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:171: undefined reference to `glGenRenderbuffersEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:172: undefined reference to `glBindRenderbufferEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:173: undefined reference to `glRenderbufferStorageEXT'
/usr/bin/ld: /tmp/cc2PQ6yJ.ltrans1.ltrans.o:/usr/local/src/opencv/build/../contrib/modules/rgbd/src/dynafu.cpp:175: undefined reference to `glFramebufferRenderbufferEXT'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Using LEGACY instead of GLVND works, and this kind of change may help as well:
But ideally we should replace them with something modern.
System information (version)
Detailed description
With OpenGL enabled and RGBD, it does not compile due to an error:
The exact code that is failing is here:
Steps to reproduce
Compile with OpenGL and RGBD enabled.