How to solve the conflicts between driverworks and the third party?

Hi, all. We are using Pangolin library(https://github.com/stevenlovegrove/Pangolin) for 3D display( visualisation). The Pangolin library’s heart is a simple OpenGl viewport manager which aslo uses the header files of OpenGL as driverworks does. That is the reason of conflict.

More specifically, in our program, we use driverwork to capture the images of camera as the GMSL Camera Capture Sample does. At the same time, we also use Pangolin library to display the results of our program at real-time.

Some examples of error from the compilation results are as follows:

In file included from /usr/local/driveworks/include/dw/gl/GL.h:38:0,
                 from /usr/local/driveworks/include/common/Checks.hpp:4,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/cameradriver.h:35,
                 from /home/nvidia/Desktop/Enc_SLAM2/Examples/mono_fish.cc:10:
/usr/include/GLES3/gl3.h:1128:75: error: ‘void __glewBeginTransformFeedback(GLenum)’ redeclared as different kind of symbol
 GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
                                                                           ^
In file included from /home/nvidia/software/Pangolin-master/include/pangolin/gl/glplatform.h:59:0,
                 from /home/nvidia/software/Pangolin-master/include/pangolin/gl/glinclude.h:30,
                 from /home/nvidia/software/Pangolin-master/include/pangolin/display/viewport.h:30,
                 from /home/nvidia/software/Pangolin-master/include/pangolin/gl/gl.h:30,
                 from /home/nvidia/software/Pangolin-master/include/pangolin/pangolin.h:33,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/MapDrawer.h:27,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/Viewer.h:26,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/Tracking.h:28,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/System.h:29,
                 from /home/nvidia/Desktop/Enc_SLAM2/Examples/mono_fish.cc:9:
/usr/include/GL/glew.h:16648:49: note: previous declaration ‘void (* __glewBeginTransformFeedback)(GLenum)’
 GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback;
                                                 ^
In file included from /usr/local/driveworks/include/dw/gl/GL.h:38:0,
                 from /usr/local/driveworks/include/common/Checks.hpp:4,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/cameradriver.h:35,
                 from /home/nvidia/Desktop/Enc_SLAM2/Examples/mono_fish.cc:10:
/usr/include/GLES3/gl3.h:1129:57: error: ‘void __glewEndTransformFeedback()’ redeclared as different kind of symbol
 GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
                                                         ^
In file included from /home/nvidia/software/Pangolin-master/include/pangolin/gl/glplatform.h:59:0,
                 from /home/nvidia/software/Pangolin-master/include/pangolin/gl/glinclude.h:30,
                 from /home/nvidia/software/Pangolin-master/include/pangolin/display/viewport.h:30,
                 from /home/nvidia/software/Pangolin-master/include/pangolin/gl/gl.h:30,
                 from /home/nvidia/software/Pangolin-master/include/pangolin/pangolin.h:33,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/MapDrawer.h:27,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/Viewer.h:26,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/Tracking.h:28,
                 from /home/nvidia/Desktop/Enc_SLAM2/include/System.h:29,
                 from /home/nvidia/Desktop/Enc_SLAM2/Examples/mono_fish.cc:9:
/usr/include/GL/glew.h:16659:47: note: previous declaration ‘void (* __glewEndTransformFeedback)()’
 GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback;

Many redeclarations of variables originated from OpenGL happen and the compilation can not be succesfully finished. Apparently, this because both driverworks and the Pangolin library depend on the OpenGL library.

Does anyone can give us great advices to solve this problem?

Many thanks!

Dear prairiewolf.scopus,
Is it possible to make changes to use common method for both? If so, could you check that

Thank you for your attention!

Sorry. For now we could not put the common methods between Pangolin and Driverworks into an another package. In fact, we don’t know how to do this.

One solution that we can think of is using other library for 3D visualization to replace Pangolin. But we are very reluctantly to abandon Pangolin.

Still looking forwards to any solution to the conflicts between the driverworks and the third parties.
Many users may also use other third parties which maybe are conflict to driverworks. So it would be convenient to many cases if this is solved.

Hi,

one solution is to X-compile Pangolin with your code on the host. This is is very challenging and you may face several gcc errors during compilation.

First off, please verify our OpenGL version is compatible with your version of Pangolin. Else adapt your Pangolin version accordingly to match the OpenGL one.

  • Fabian