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

Fixing compilation errors related to OpenGL #3604

Closed
wants to merge 0 commits into from
Closed

Fixing compilation errors related to OpenGL #3604

wants to merge 0 commits into from

Conversation

du-xinyi
Copy link

@du-xinyi du-xinyi commented Dec 7, 2023

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@opencv-alalek
Copy link

How to validate your patch?
What is the original error message? what are passed parameters to CMake? what is used build configuration (OS/compiler)?

@du-xinyi
Copy link
Author

du-xinyi commented Dec 8, 2023

如何验证您的补丁? 原来的错误信息是什么?向 CMake 传递的参数是什么?使用什么构建配置(操作系统/编译器)?

When I compiled rgbd module in ubuntu20.04. It has the error

/usr/bin/ld: CMakeFiles/opencv_rgbd.dir/src/dynafu.cpp.o: in function cv::dynafu::DynaFuImpl<cv::Mat>::DynaFuImpl(cv::kinfu::Params const&)': dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x3ec): undefined reference to glGenRenderbuffersEXT'
/usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x3f9): undefined reference to glBindRenderbufferEXT' /usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x410): undefined reference to glRenderbufferStorageEXT'
/usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x41e): undefined reference to glGenFramebuffersEXT' /usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x42b): undefined reference to glBindFramebufferEXT'
/usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x442): undefined reference to glFramebufferRenderbufferEXT' /usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x450): undefined reference to glGenRenderbuffersEXT'
/usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x45d): undefined reference to glBindRenderbufferEXT' /usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x474): undefined reference to glRenderbufferStorageEXT'
/usr/bin/ld: dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x48b): undefined reference to `glFramebufferRenderbufferEXT'
collect2: error: ld returned 1 exit status
make[2]: *** [modules/rgbd/CMakeFiles/opencv_rgbd.dir/build.make:505: lib/libopencv_rgbd.so.4.8.1] Error 1

In the original code, contains the header file is '#include <GL/gl.h>', but when I view the file in /usr/include/Gl. The relevant functions are in the #include <GL/glew.h> file

I use gcc 9.4.0 to compiled. It need pass glew to cmake

@du-xinyi du-xinyi closed this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants