1
Window / Re: [OSX] Segfault in sf::Window::pollEvent
« on: August 12, 2013, 01:43:30 pm »
UPDATE: Turns out I was corrupting my window... My bad.
[on a side note, GO VALGRIND]
[on a side note, GO VALGRIND]
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#0 0x00007fff8fc90250 in objc_msgSend ()
#1 0x00000001000fce18 in typeinfo for sf::GlResource ()
#2 0x00007fff8f2a4602 in __CFRunLoopModeIsEmpty ()
#3 0x00007fff8f2c8037 in CFRunLoopRunSpecific ()
#4 0x00000001000dd934 in sf::priv::HIDJoystickManager::update (this=0x1000fdeb0) at /Users/linus/Programming/SFML/src/SFML/Window/OSX/HIDJoystickManager.cpp:127
#5 0x00000001000dd8e9 in sf::priv::HIDJoystickManager::getJoystickCount (this=0x1000fdeb0) at /Users/linus/Programming/SFML/src/SFML/Window/OSX/HIDJoystickManager.cpp:58
#6 0x00000001000ddc9e in sf::priv::JoystickImpl::isConnected (index=0) at /Users/linus/Programming/SFML/src/SFML/Window/OSX/JoystickImpl.cpp:87
#7 0x00000001000d046a in sf::priv::JoystickManager::update (this=0x1000fcf48) at /Users/linus/Programming/SFML/src/SFML/Window/JoystickManager.cpp:80
#8 0x00000001000d60c5 in sf::priv::WindowImpl::processJoystickEvents (this=0x1013104d0) at /Users/linus/Programming/SFML/src/SFML/Window/WindowImpl.cpp:148
#9 0x00000001000d5f9e in sf::priv::WindowImpl::popEvent (this=0x1013104d0, event=@0x7fff5fbff988, block=false) at /Users/linus/Programming/SFML/src/SFML/Window/WindowImpl.cpp:105
#10 0x00000001000d537c in sf::Window::pollEvent (this=0x7fff5fbffa90, event=@0x7fff5fbff988) at /Users/linus/Programming/SFML/src/SFML/Window/Window.cpp:186
#11 0x0000000100003f3b in Sim::run (this=0x7fff5fbffa30) at /Users/linus/programming/swarmers-v3/Sim.cpp:65
#12 0x0000000100002ec9 in main () at /Users/linus/programming/swarmers-v3/main.cpp:7
Thanks. I hadn't seen the libs in the SFML source distro.No, the builds on the site are probably made using MinGW on Windows. As for finding the libraries, it's possible that your toolchain script doesn't define all the necessary CMake variables. As I said:
That got me a few steps further. I was also missing the LIBRARY and INCLUDE variables for the various libraries in the toolchain file. Now it's failing like so:
Linking CXX shared library ../../../lib/sfml-graphics-2.dll
..
undefined reference to `glewInit'
undefined reference to `_jpeg_std_error'
etc.
I would have thought that there was a script to perform this process already, since the MinGW binary downloads on the website must be produced using a method such as this, using MinGW, on Linux, to create Windows binaries.
Rgds,
ElColmo
Could you upload the toolchain file?
There is something we haven't discussed yet.I'm not sure. We'd have to test it. I need to ask my dad if he has some OS 10.5 installation media, if he does I can test it in a VM.
What about older OS version? I fear that using homebrew to build SFML for older OS version (say, 10.5 since we currently support it) won't be possible.
One other thing: what happen when SFML if build & installed with freetype x.y and then freetype is upgraded to x.z or v.w without rebuilding SFML? That may introduced some incompatibility, or am I wrong?
For reference, here is some work done to create a Formula for Homebrew with a beginning of discussion: https://github.com/mxcl/homebrew/pull/20765Yes, that was me (see the similar name? )
Currently, I'm not sure how to approach this issue. I'm not experienced enough with Homebrew, I guess. But it would really be nice to make `brew install sfml` possible.You participated in the discussion on github? Are you mantognini?
In the discussion on github I mentioned, vaguely, the possibility to use a special patch to build SFML from brew. I don't know exactly how the patching system works with brew but I've seen it with vim formula, I think. But here are a (non-exhaustive) list of issues that need to be addressed with such patch:
- Xcode templates needs sndfile.framework, freetype.framework and SFML frameworks in /Library/Frameworks/. If they are saved in another location, such as /usr/local/somewhere, that's not an issue as long as this location is fixed and can be determined when installing the templates. I can create a patch for the current template to do that quite easily.
- Xcode templates needs sndfile.framework and freetype.framework. This is because the shell script used by the templates expect frameworks. But a patch can easily be written to use dylibs instead of frameworks.
- Xcode templates need to be installed in /Library/Developer/Xcode/Templates/. You mentioned that brew won't install anything outside its prefix. This can be worked around with some linking, I think. I've seen some formulae installing application to ~/Applications.
- Theoretically, custom version of extlibs can be used to compile SFML when configuring properly CMake. I haven't tested it though. But, as eXpl0it3r said, it would be easier to use brew version of these external libs.
- If SFML is compiled as frameworks, but are not installed in /Library/Frameworks, and cannot be linked there, I can patch the Xcode templates and make sure the compiler will look for them in the right place.
Homebrew won’t install files outside its prefix, and you can place a Homebrew installation wherever you like.I can't break this convention if I want the formula to get included in the main Homebrew repository, so seeing as Mac OS doesn't search /usr/local/ for frameworks (right? correct me if I'm wrong) installing frameworks from a homebrew formula isn't really a possibility/desirable functionality.