So, I recently encountered a problem that OpenGL example that comes with SFML package can no longer be compiled after upgrade to Mojave 14.1. The thing is, since OpenGL is deprecated in Mojave (why Apple, why?!.) the example no longer works as it is now (I compiled it before, with High Sierra). The compiler first ask to define a macro:
#ifndef GL_SILENCE_DEPRECATION
#define GL_SILENCE_DEPRECATION
#endif
With this, you can compile the cpp file without warnings but when it comes to linker, then there is an error message:
Undefined symbols for architecture x86_64:
"_glClear", referenced from:
_main in SFML-8f1fd1.o
"_glClearDepth", referenced from:
_main in SFML-8f1fd1.o
"_glDepthMask", referenced from:
_main in SFML-8f1fd1.o
"_glDisable", referenced from:
_main in SFML-8f1fd1.o
"_glDisableClientState", referenced from:
_main in SFML-8f1fd1.o
"_glDrawArrays", referenced from:
_main in SFML-8f1fd1.o
"_glEnable", referenced from:
_main in SFML-8f1fd1.o
"_glEnableClientState", referenced from:
_main in SFML-8f1fd1.o
"_glFrustum", referenced from:
_main in SFML-8f1fd1.o
"_glLoadIdentity", referenced from:
_main in SFML-8f1fd1.o
"_glMatrixMode", referenced from:
_main in SFML-8f1fd1.o
"_glRotatef", referenced from:
_main in SFML-8f1fd1.o
"_glTexCoordPointer", referenced from:
_main in SFML-8f1fd1.o
"_glTranslatef", referenced from:
_main in SFML-8f1fd1.o
"_glVertexPointer", referenced from:
_main in SFML-8f1fd1.o
"_glViewport", referenced from:
_main in SFML-8f1fd1.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What to do, as I am just out of ideas now.