Cannot Install OpenCV 3.3.1 on JetPack 4.2.3

When I try to install OpenCV using a makefile, I get the error:

error: #error Please include the appropriate gl headers before including cuda_gl_interop.h

error Please include the appropriate gl headers before including cuda_gl_interop.h

I have found a forum addressing this for earlier versions of JetPack, but those fixes did not work for me. I already have an earlier version of OpenCV installed, but it does not work with my video input, a MIPI-CSI Camera. Any help on either issue would solve this for me.

That’s a bit too old to support now.
Suggest to move on the latest JetPack 4.6 with newer OpenCV.

A solution to this problem is here:

Command line solution

sudo su
cp /usr/local/cuda/targets/aarch64-linux/include/cuda_gl_interop.h /usr/local/cuda/targets/aarch64-linux/include/cuda_gl_interop.h.org
perl -0 -i -pe 's|#else /\* __APPLE__ \*/[\s\S]*#endif /\* __APPLE__ \*/|#else /* __APPLE__ */\n\n#include <GL/gl.h>\n\n#endif /* __APPLE__ */|gim' /usr/local/cuda/targets/aarch64-linux/include/cuda_gl_interop.h

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.