Code Monkey home page Code Monkey logo

Comments (10)

mantognini avatar mantognini commented on May 18, 2024

Finally got an answer from some Apple dev. They apparently don't want to fix this issue on their side. They gave me three workarounds :

  • Use extern template class std::basic_string<int>; in String.cpp and add template class std::basic_string<int>; in ALL C++ source that uses sf::String. Clearly not feasible, of course.
  • Use clang with its new std lib ( -stdlib=libc++ compiler option ). This is available only on Mac OS X 10.7+ thus this is not suitable for SFML.
  • Use std::vector instead of std::basic_string and manually manage trailing \0.

The last solution is the better but still I don't like it : modifying a part of SFML that work on other OSes to make it work on Mac is not a solution.

From this perspective I guess the above workaround with _GLIBCXX_FULLY_DYNAMIC_STRING macro is the only solution that I know of at this moment.

from sfml.

mjbshaw avatar mjbshaw commented on May 18, 2024

Out of curiosity, why would the first option not be feasible? template class std::basic_string<int>; could just be put in String.hpp, could it not?

from sfml.

mantognini avatar mantognini commented on May 18, 2024

Good question. I didn't remember so I did the modification to test. Here is the diff.

The problem is, apparently, it creates duplicate symbols with predefined templates.

from sfml.

dansgithubuser avatar dansgithubuser commented on May 18, 2024

I didn't compile SFML from source, and I wanted a different way to size text in any case. The easiest thing for me was to create an sf::Text alternative myself, copying from Text.hpp and Text.cpp and using something other than sf::String.

from sfml.

mantognini avatar mantognini commented on May 18, 2024

using something other than sf::String.

but you know that this issue is directly related to the underlying std::basic_string, right?

from sfml.

eXpl0it3r avatar eXpl0it3r commented on May 18, 2024

Of course it's not nice to keep things around that can possible crash an application, but I wonder whether it's a library's job to implement workarounds for broken STL implementations, especially if it's only for a specific and older version.

On the other hand if it's just a simple version check and flag setting in CMake, I don't see a reason not to implement it and reading a bit more (e.g. here) about that flag it seems common practice to do so.

The question is of course, whether there's still someone around with that old system setup who can test a possible implemented fix. . 😉

from sfml.

LaurentGomila avatar LaurentGomila commented on May 18, 2024

Marco plans to drop support for OS X 10.5 and 10.6 in a near future. I guess that will solve this problem.

from sfml.

mantognini avatar mantognini commented on May 18, 2024

Unfortunately, it is still present on 10.7/8 since gcc is still available on those OSes. But I guess implementing the fix as @eXpl0it3r suggested should not harm anyone.

from sfml.

mjbshaw avatar mjbshaw commented on May 18, 2024

But GCC has been removed since Xcode 4.2...

from sfml.

mantognini avatar mantognini commented on May 18, 2024

Right! They replaced it with llvm-gcc. So it should be safe to close this issue now without a fix.

from sfml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.