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

Author Topic: Compiling sfml for OSX  (Read 2728 times)

0 Members and 1 Guest are viewing this topic.

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Compiling sfml for OSX
« on: December 03, 2012, 08:55:07 am »
Hi.

I was recently trying to build the sfml 2 sources on OS X Mountain Lion.
Set up all the build stuff. xcode, command line utils and codeblocks.

I used the cmake gui to set everything up and got it to configure and generate after pointing it to freetype lib.

Open the codeblocks project for it and when I try and build I got this.

src/sfml/SFML/Window/GlContext.cpp 105   error: allocating an object of abstract class type 'SFContext'
src/sfml/SFML/Window/GlContext.hpp 174   note: unimplemented pure virtual method 'setVerticalSyncEnabled'  in 'SFContext'
src/sfml/SFML/Window/GlContext.hpp 161   note: unimplemented pure virtual method 'display'  in 'SFContext'
src/sfml/SFML/Window/GlContext.hpp 193   note: unimplemented pure virtual method 'makeCurrent'  in 'SFContext'
src/sfml/SFML/Window/GlContext.cpp 142   error: allocating an object of abstract class type 'SFContext'
src/sfml/SFML/Window/GlContext.cpp 159   error: allocating an object of abstract class type 'SFContext'
src/sfml/SFML/Window/GlContext.cpp 170   error: allocating an object of abstract class type 'SFContext'

Note: I hand typed this. Posting on a different pc. so excuse typos
 

When I look in src/sfml/SFML/Window/OSX/SFContext.hpp those functions are defined and are not abstract(no =0).

Also in src/sfml/SFML/Window/OSX/SFContext.mm those functions are defined.

Now I am using it with codeblocks with makefiles

I also tried to do it with generating xcode project from cmake. It also had the same errors. Though lacked the notes.

It is really strange and I can not work it out.

Also I really need to build these myself not previously built binaries.


Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Compiling sfml for OSX
« Reply #1 on: December 03, 2012, 08:27:34 pm »
Did you try what the tutorial says explicitly, that is generating Makefile with Cmake ?

Otherwise, try redownloading SFML again. Maybe...
SFML / OS X developer

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Compiling sfml for OSX
« Reply #2 on: December 04, 2012, 02:53:54 am »
I did not realize sfml 2 had a build tutorial yet. Also google failed me all I could find was this page with stuff down the bottom

http://www.sfml-dev.org/tutorials/1.5/start-osx.php

Though regardless when I generate the unix makefile and execute it from the command line I get the same errors as from generating "codeblocks - unix makefile". Which makes sense I suppose.

I suppose I will download the latest from Laurents git and see if I have any luck there.


Edit:

Seems downloading the latest one seems to work better.
Now when it tried to build the opengl example it dies because of freetype it looks like.
Was trying to be clever by compiling freetype myself.
seems it is missing symbols for bz2 and gzip

This is more my problem to solve. Thanks a lot for the help.

« Last Edit: December 04, 2012, 03:10:47 am by greeniekin »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Compiling sfml for OSX
« Reply #3 on: December 04, 2012, 04:18:50 pm »
You don't need to compile freetype yourself. Install XQuartz instead. Less painful.
SFML / OS X developer

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Compiling sfml for OSX
« Reply #4 on: December 05, 2012, 02:26:38 am »
I've heard that there has been some issues with using quartz.
That when you run the app on other peoples mac it tells them to go to the website and download quartz.

I figure If I compile it and link statically it will not be a problem. Seems to have worked I have had nothing about installing quartz when just running the sfml examples. Though I also have not packaged them up and tried to install them. Which might be where the issue comes from.