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

Author Topic: C++11 and SFML 2.0  (Read 9941 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 #30 on: February 16, 2013, 05:40:54 am »
Oh jeez, only slightly outdated.. o.o

I have quite a slow connection due to where I live but once the tools have downloaded and I can run cmake and all that again I'll tell you how it went.

Thanks so much for the help, I really appreciate it. :D

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: C++11 and SFML 2.0
« Reply #31 on: February 16, 2013, 08:38:12 am »
Finally got it working thanks to you :)

I couldn't just run my SFML project straight away, I had to set the search path and add the linked framework and library but it still works :D

Thanks again, you were a massive help!

Alec

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: C++11 and SFML 2.0
« Reply #32 on: May 03, 2013, 12:58:37 pm »
Continuing on this theme.  I'd like to build SFML 2.0 on Linux, initially w/ gcc, and ideally w/ make.  I asked on a separate thread about this, and the helpful reply pointed me towards a route using CMake.  Fine.  But I'd like further help on this wrt the use of C++11.  That is, my app code would be built w/ C++11.  Should SFML be built as C++11 (and if so how do I supply the parameter(s) for this?  And for all the libs that SFML uses, should they also be built and installed using a C++11 compiler; or would installation of the dependent libs from packages (probably built w/ C and/or C++ elements)  a) be well-defined, and expected to work, or b) work in practice, but in theory use undefined behaviour, or c) be unreliable at best?

TIA,

Alec

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: C++11 and SFML 2.0
« Reply #33 on: May 03, 2013, 01:13:20 pm »
Isn't -std=c++11 the default, starting from gcc 4.7? i.e. you don't have to do anything to get C++11 support.
If not, you must add -std=c++11 to the CMAKE_CXX_FLAGS CMake variable.

SFML only uses C dependencies, so there's no C++11 problem with them.
Laurent Gomila - SFML developer

Alec

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: C++11 and SFML 2.0
« Reply #34 on: May 03, 2013, 02:56:51 pm »
Thanks, but my understanding is that although available, C++11 is not the default.  (See: http://gcc.gnu.org/onlinedocs/gcc/Standards.html , which states: "The default, if no C++ language dialect options are given, is -std=gnu++98."  ISTR seeing - but can't find - another authoritative quote stating, effectively, that it was not likely to become so anytime soon.)

And I'm concerned about the binary compat issues.  See e.g.:

http://gcc.gnu.org/ml/gcc-help/2013-03/msg00035.html

http://gcc.gnu.org/wiki/Cxx11AbiCompatibility

Alec