SFML community forums
Help => Graphics => Topic started by: TrapAlice on January 31, 2012, 08:11:24 pm
-
I keep getting the error 0xC0000005: Access violation reading location 0xcccccccc.
Minimal example:
#include <SFML/Graphics.hpp>
int main(){
sf::Font font;
font.LoadFromFile("lucon.ttf");
sf::Text text("Test", font, 30);
}
-
http://www.sfml-dev.org/forum/viewtopic.php?t=5559
-
Callstack
sfml-system-d-2.dll!std::_Char_traits<unsigned int,long>::assign(unsigned int & _Left, const unsigned int & _Right) Line 215 + 0x6 bytes C++
sfml-system-d-2.dll!std::_Char_traits<unsigned int,long>::copy(unsigned int * _First1, const unsigned int * _First2, unsigned int _Count) Line 167 + 0xd bytes C++
sfml-system-d-2.dll!std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >::assign(const std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> > & _Right, unsigned int _Roff, unsigned int _Count) Line 903 + 0x21 bytes C++
sfml-system-d-2.dll!std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >(const std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> > & _Right) Line 546 C++
sfml-system-d-2.dll!sf::String::String(const sf::String & copy) Line 132 C++
sfml-graphics-d-2.dll!sf::Text::Text(const sf::String & string, const sf::Font & font, unsigned int characterSize) Line 59 + 0x74 bytes C++
MoonEnginev2.exe!moon::Draw::DrawText(moon::Window * pTarget, std::basic_string<char,std::char_traits<char>,std::allocator<char> > pText, int pX, int pY, moon::Colour pCol) Line 33 + 0x61 bytes C++
Running on Windows 7 with a Nvidia graphics card, using the latest revision off github.
-
Which CMake options did you use to compile SFML?
-
What I have in CMake is:
(http://i44.tinypic.com/2wfn0k6.png)
-
Hmm... your screenshot shows "Release" but the DLL name (sfml-system-d-2.dll) implies Debug.
-
Tried changing it from Release to Debug, still has the same problem.
-
My point was that your CMake settings don't match the DLL that causes the error. So make sure that you're really using the DLLs that you recompiled, and not an older version that would be lost somewhere on your hard drive.
Even your callstack doesn't match the code that you're showing.
Please provide consistent information, otherwise we won't be able to help you.
-
It was a complete screw up I've made, I was including the release libs but using the debug dlls..
-
It was a complete screw up I've made, I was including the release libs but using the debug dlls..
It is nearly impossible to mix the debug and release DLLs, they have a different name. The only way to screw up is to add/remove the "-d" suffix yourself.