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?