0

I'm trying to compile some linux code which uses freeglut on OS X. I have installed freeglut using homebrew but am now getting a bunch of warnings about having both gl.h and gl3.h, but more worryingly, I'm getting this linker error:

Undefined symbols for architecture x86_64:
  "_glutMainLoopEvent", referenced from:
      main::$_1::operator()() const in main.cpp.o
ld: symbol(s) not found for architecture x86_64

Here is the command-line compiler command I used:

FAILED: : && /Library/Developer/CommandLineTools/usr/bin/c++
-Wl,-search_paths_first -Wl,-headerpad_max_install_names prog/CMakeFiles/prog.dir/main.cpp.o -o prog/prog lib/display/libdisplay.a -framework AGL -framework OpenGL -framework GLUT -framework Cocoa lib/training/libtraining.a lib/core/libcore.a lib/utility/libutility.a -lpthread /usr/local/lib/libboost_log-mt.dylib /usr/local/lib/libboost_thread-mt.dylib /usr/local/lib/libboost_system-mt.dylib /usr/local/lib/libboost_filesystem-mt.dylib /usr/local/lib/libboost_unit_test_framework-mt.dylib /usr/local/lib/libboost_program_options-mt.dylib && :

What am I doing wrong?

quant
  • 21,507
  • 32
  • 115
  • 211
  • The error is telling you that the definition of the function _glutMainLoopEvent is missing. I suspect the library is not being found. – TheDarkKnight Jun 04 '15 at 12:04
  • @TheDarkKnight which library? And how do check whether or not it's missing? – quant Jun 05 '15 at 10:54
  • Are you trying to use a non-apple library, such as [The Free GLUT Library](http://freeglut.sourceforge.net/docs/api.php)? It's something to do with OpenGL, but that's not really my area of expertise. – TheDarkKnight Jun 05 '15 at 13:01
  • @TheDarkKnight yeah that's right. From what I've read it might not be possible to create a cross platform GLUT application that works across OSX/Linux without macro dodginess. I'm going to make the switch to SFML. GLUT was possibly overkill for my application anyway. – quant Jun 06 '15 at 00:35

0 Answers0