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

Author Topic: Compiling SFML 2.1 in OS X 10.9.5 and C++11 support  (Read 1149 times)

0 Members and 1 Guest are viewing this topic.

jstark

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Compiling SFML 2.1 in OS X 10.9.5 and C++11 support
« on: September 29, 2014, 08:46:30 pm »
Hi,

I'm trying to compile SFML 2.1 from sources on OS X 10.9.5 (Xcode 6.0.1). I'm generating the required Makefile with

cmake -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++"

and I'm getting the following errors after running make:

Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/OSX/SFApplication.m.o
error: invalid argument '-std=c++11' not allowed with 'C/ObjC'
make[2]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/OSX/SFApplication.m.o] Error 1


I'm guessing that some *.m files are passed to clang++ and there is a conflict there. I renamed all *.m files to *.mm and after fixing another compiler error (a simple cast) everything worked fine.

So, am I mistaken ? Or is this a known issue in OS X ?


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Compiling SFML 2.1 in OS X 10.9.5 and C++11 support
« Reply #1 on: September 29, 2014, 09:24:14 pm »
Did you read the official tutorials?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jstark

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Compiling SFML 2.1 in OS X 10.9.5 and C++11 support
« Reply #2 on: September 29, 2014, 09:27:06 pm »
I think yes, but if I misread something, please forgive me. I'll give them another look right now.

@eXpl0it3r

Well, forgive me, I made a mistake (forgot a -DCMAKE_C_FLAGS option). I apologize. 
« Last Edit: September 29, 2014, 09:34:02 pm by jstark »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Compiling SFML 2.1 in OS X 10.9.5 and C++11 support
« Reply #3 on: September 29, 2014, 09:32:10 pm »
I'm aware of this. It will change the day we need C++11 in SFML code but in the meantime you don't need -std=c++11 to compile SFML. See §C++11 and Mac OS X in this tutorial http://sfml-dev.org/tutorials/2.1/compile-with-cmake.php for more details.
SFML / OS X developer

 

anything