Comments (10)
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 addtemplate 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 ofstd::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.
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.
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.
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.
using something other than sf::String.
but you know that this issue is directly related to the underlying std::basic_string
, right?
from sfml.
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.
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.
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.
But GCC has been removed since Xcode 4.2...
from sfml.
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)
- [2.6.1] Drawing to RenderTexture "fails" after Texture copied from (Windows) HOT 3
- Add a CMake guide for static linking the library in MacOS/Linux HOT 1
- `sf::VideoMode::getDesktopMode()` returning the monitor resolution on macOS HOT 2
- Install prefix not honored HOT 3
- Consider changing `sf::Texture::invalidateMipmap()` from private to public HOT 4
- Creating a window when statically linking on macOS causes a crash HOT 2
- MacOS static release HOT 1
- Cannot disable SFML installation targets when installing a game which includes SFML with fetch content HOT 4
- Revert change to `sf::Drawable::draw` signature which made `sf::RenderStates` a const reference, and make it a copy again HOT 10
- (Linux) Window Close Event not triggered with sf::Style None, Titlebar, Resize
- Cannot create DRM context without X server running. HOT 2
- sfml window example crashes due to acess violation on joystick driver ezfrd64.dll HOT 3
- Add support for QOI (Quite OK Image) and QOA (Quite OK Audio) formats HOT 2
- Store angles internally as radians HOT 3
- Graphic glitch when displaying text containing non-breaking spaces HOT 2
- `sf::Text::findCharacterPos()` doesn't report the correct Y location HOT 8
- What are you doing with Event? HOT 6
- `operator*` overload in sf::Vector2<T> and sf::Vector3<T> template class HOT 2
- iOS reports gyroscope rates as deg/s while Android reports radians/s HOT 1
- `sf::err()` is not thread-safe HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sfml.