I'm not sure if anyone has had this same problem and found a solution, but I built OpenCV on one machine, and it functions completely normally with OpenGL. I've tried to copy the build to another computer where it runs normally with normal OpenCV functionality (including CUDA), but if I try to use OpenGL functionality (e.g. namedWindow options) then it gives the error that it wasn't built with OpenGL.
Any advice would be much appreciated.