Menu

#259 Builds fine on Windows; not so on MacOS?

open
nobody
MacOS (1)
5
2020-12-14
2020-12-05
John A
No

Hi, I have been using freeglut 3.x for quite some time successfully in Windows and Linux. Recently, a project requirement came up to use it on MacOS Catalina. I am having trouble building the static and shareable libraries with the cmake build environment (3.x). Basically, I get about 1/2 way through the build and then get these build errors below. I haven't found a solution to the problem yet... Am I missing something obvious here or is this a known issue with building freeglut under MacOS? Thanks...

[ 47%] Building C object CMakeFiles/freeglut.dir/src/x11/fg_window_x11_glx.c.o
[ 48%] Building C object CMakeFiles/freeglut.dir/src/util/xparsegeometry_repl.c.o
[ 50%] Linking C shared library lib/libglut.dylib
Undefined symbols for architecture x86_64:
"_glXChooseFBConfig", referenced from:
_fgPlatformGlutGetModeValues in fg_state_x11_glx.c.o
_fghChooseConfig in fg_window_x11_glx.c.o
"_glXCreateNewContext", referenced from:
_fghCreateNewContext in fg_window_x11_glx.c.o
"_glXDestroyContext", referenced from:
_fgPlatformDestroyContext in fg_init_x11.c.o
_fgPlatformCloseWindow in fg_window_x11.c.o
"_glXGetCurrentContext", referenced from:
_fgPlatformOpenWindow in fg_window_x11.c.o
"_glXGetFBConfigAttrib", referenced from:
_fgPlatformGetConfig in fg_state_x11_glx.c.o
_fgPlatformGlutGetModeValues in fg_state_x11_glx.c.o
_fghChooseConfig in fg_window_x11_glx.c.o
"_glXGetProcAddressARB", referenced from:
_fgPlatformGetProcAddress in fg_ext_x11.c.o
"_glXGetVisualFromFBConfig", referenced from:
_fgPlatformGlutGet in fg_state_x11.c.o
_fgPlatformOpenWindow in fg_window_x11.c.o
"_glXIsDirect", referenced from:
_fgPlatformOpenWindow in fg_window_x11.c.o
"_glXMakeContextCurrent", referenced from:
_fgPlatformOpenWindow in fg_window_x11.c.o
_fgPlatformSetWindow in fg_window_x11_glx.c.o
"_glXQueryExtension", referenced from:
_fgPlatformInitialize in fg_init_x11.c.o
"_glXQueryExtensionsString", referenced from:
_fgPlatformInitialize in fg_init_x11.c.o
"_glXSwapBuffers", referenced from:
_fgPlatformGlutSwapBuffers in fg_display_x11_glx.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: [lib/libglut.3.11.0.dylib] Error 1
make[1]:
[CMakeFiles/freeglut.dir/all] Error 2

Related

Bugs: #259

Discussion

  • John A

    John A - 2020-12-08

    Thanks for the quick response John T. I ended up disabling the build of the shareable library and was able to build the static library. Then, the problem simply shifted to applications trying to use the freeglut static library; i.e., as you pointed out, the GLX/X11 libraries being referenced by libfreeglut.a seem were deprecated by Apple; I haven't been successful yet in getting them restored in the MacOS Catalina version yet. If and when I find a way to get freeglut to work again on the Mac, I'll update this bug report.

     
  • Steve Andrews

    Steve Andrews - 2020-12-14

    I just tried to build freeglut on Mac OS 10.14 (Mojave) and got the exact same problem. I'm equally stumped on how to fix it.

    For what it's worth, I was able to install freeglut successfully using MacPorts, but that didn't include the static library that I was hoping for (it does have several .dylib files though). It also came with several .cmake files which might have been useful, but all of my efforts to include them in my project using CMake failed, so I gave up.

     

Log in to post a comment.