Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Faberge

Pages: [1]
1
General / Re: OpenGL example from SFML and macOS Mojave
« on: November 16, 2018, 08:51:47 am »
Yes, the Graphics module works fine, I can compile and run a simple 2D examples from SFML Tutorial book I currently read. But not OpenGL 3D example. Maybe something needs to be change for linker options? I swear they were ok for High Sierra but still.

Quote
g++ -Wall -Wpedantic -std=c++17 -o "%e" "%f" -L /System/Library/Frameworks/OpenGL.framework/ -lsfml-graphics -lsfml-window -lsfml-system

2
General / OpenGL example from SFML and macOS Mojave
« on: November 15, 2018, 01:37:46 pm »
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:

Quote
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.

Pages: [1]