Build Failure on Mac OS X (GLX support) (Bug #4495)
Description
On Mac OS X 10.6.8 configured with OpenGL, build stops at modules/highgui/src/window_QT.cpp:3364 with a not-declared error of a GLX function.
<builddir>/opencv/modules/highgui/src/window_QT.cpp: In member function ‘virtual void GlFuncTab_QT::generateBitmapFont(const std::string&, int, int, bool, bool, int, int, int) const’: <builddir>/opencv/modules/highgui/src/window_QT.cpp:3364: error: ‘glXUseXFont’ was not declared in this scope <builddir>/opencv/modules/highgui/src/window_QT.cpp:3355: warning: unused variable ‘cvFuncName’ make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.cpp.o] Error 1 make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 make: *** [all] Error 2
This is, to the best of my knowledge, the only usage of a GLX function when building with Mac OS X. It isn't appropriate to use GLX on Mac OS X because Apple uses AGL's aglUseFont for the same purpose.
This error may be related to improper #ifdef@s: At the top of window_QT.cpp,
#ifdef Q_WS_X11@ is used to guard the inclusion of GL/glx.h. However, at line 3364, a #ifndef Q_WS_WIN is used to guard the use of glXUseXFont. This allows a non-Windows machine possessing X11 but lacking GLX (i.e. Mac OS X) to reach the faulty call.
Related issues
duplicates Bug #1603: Build Failure on Mac OS X (GLX support) | Open | 2012-02-15 |
History
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/5078