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

Author Topic: C++11 and SFML 2.0  (Read 9947 times)

0 Members and 1 Guest are viewing this topic.

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: C++11 and SFML 2.0
« Reply #15 on: February 14, 2013, 09:33:32 am »
Okay I have found what causes the issue. :)

In my build settings I have this by default:


Which gives me errors on the SFML side of things:


To fix it I set it to the compiler default:


Which causes me to lose C++11 compatibility:


Anyone know how to get around this?

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: C++11 and SFML 2.0
« Reply #16 on: February 14, 2013, 02:36:20 pm »
Recompile and install SFML with C++11 did the trick for me.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: C++11 and SFML 2.0
« Reply #17 on: February 14, 2013, 04:06:22 pm »
You should use the new templates for Xcode (i.e. do as Gan said). They now support C++11 setup painlessly.
SFML / OS X developer

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: C++11 and SFML 2.0
« Reply #18 on: February 14, 2013, 06:53:58 pm »
Thanks for the help guys :)

So to get the new templates for Xcode I have to recompile SFML with C++11, any tutorials on how to do this?

Is this what you mean? http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php
« Last Edit: February 14, 2013, 07:42:48 pm by MarcuzPwnz »

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: C++11 and SFML 2.0
« Reply #19 on: February 14, 2013, 09:23:12 pm »
That's it. But make sure to set is as a Unix Makefile, clang compiler and set the c++11 flags like it says on the Xcode page.

Then do sudo make install on the make file and boom. Installed. Then you can open Xcode and make a new SML app from the template.

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: C++11 and SFML 2.0
« Reply #20 on: February 15, 2013, 10:03:52 pm »
Okay, I followed the tutorial and have configured and generated with CMake.

I have the following files but I'm finding the rest of the tutorial hard to follow, I'm really lost on what to do next.



Also I got no options about c++11 flags or anything like that, so I may not have even done it right. :/

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: C++11 and SFML 2.0
« Reply #21 on: February 15, 2013, 10:17:48 pm »
If you wanna be super patient, in like 3-4 hours I'll be able to make a video tutorial on how I get mine working.

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: C++11 and SFML 2.0
« Reply #22 on: February 15, 2013, 10:24:30 pm »
Sure man, that would be awesome! :D

Edit: Trying to be patient and all but if it's possible are you able to provide a download to SFML 2.0 compiled to work with C++11? :)
« Last Edit: February 16, 2013, 03:31:35 am by MarcuzPwnz »

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: C++11 and SFML 2.0
« Reply #23 on: February 16, 2013, 03:58:14 am »
There we go.

http://www.youtube.com/watch?v=OyUb8bDP2mw&feature=youtu.be

Compiled: http://cl.ly/3P1y0z3m3o30
But the process in the video auto installs it for you.
« Last Edit: February 16, 2013, 04:00:24 am by Gan »

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: C++11 and SFML 2.0
« Reply #24 on: February 16, 2013, 04:52:23 am »
Followed it exactly.

Once I got to the sudo make install in terminal I got errors.

I pasted them to Pastebin: http://pastebin.com/4ZnpKFnm

 :-\

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: C++11 and SFML 2.0
« Reply #25 on: February 16, 2013, 05:07:50 am »
:/ I wouldn't know how to fix that.

Are you using the clang compiler? What's your OS version?

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: C++11 and SFML 2.0
« Reply #26 on: February 16, 2013, 05:19:06 am »
Drats, should I just instal the download you provided?

Mac OSX: 10.7.5
My compiler is the one that comes default with the latests Xcode.
'clang' does work as a command in terminal though so I'm guessing that's what I'm using.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: C++11 and SFML 2.0
« Reply #27 on: February 16, 2013, 05:22:23 am »
I google searched some of the errors in your log. Came up with this:
http://stackoverflow.com/questions/14263735/c-std-c11-stdlib-libc-giving-errors-on-osx-lion

It seems that your clang version may be too old. If you open Xcode, go to Preferences -> Downloads, you may be able to install Command Line tools. That'd upgrade it. (Also make sure you have the latest Xcode, it's free!)

If you want to check your clang version, do this in terminal:
Quote
c++ --version

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: C++11 and SFML 2.0
« Reply #28 on: February 16, 2013, 05:28:32 am »
Thanks!

I'll go and install the command line tools and try again :)

Also I recently got the latest version of Xcode so I could use C++11 and the feedback I got from terminal was:
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix
 

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: C++11 and SFML 2.0
« Reply #29 on: February 16, 2013, 05:34:23 am »
Woh there's your problem. Mine's 4.1.

 

anything