EDIT: Solved it, I was linking the false DLL files...
Hi i just started SFML yesterday. I wanted to start with the example code for displaying text but if i try to convert a unicode string to a single-byte string and clean up later i get a access violation at _lock. First someone told me it could be the default-font bug it happens only if i use the sf and std string.
Compiler: MSVC 2010
OS: Win-7 32 Bit
Source:
#include <Windows.h>
#include <string>
#include <SFML\Graphics.hpp>
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow )
{
//sf::String sfStr("My Application");
//std::string Str = sfStr.toAnsiString();
sf::RenderWindow window(sf::VideoMode(600,400), "");
//window.setTitle(Str);
sf::Text text("First Time Test Text");
while(window.isOpen())
{
sf::Event event;
while(window.pollEvent(event))
{
if(event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(text);
window.display();
}
return 0;
}
If I uncomment the 3 lines i get a access violation reading at 0x696c7064.
Callstack:
msvcr100d.dll!_lock(int locknum) Line 348
msvcr100d.dll!operator delete(void * pUserData) Line 45 + 0x7 Bytes
WinGame.exe!std::allocator<char>::deallocate(char * _Ptr, unsigned int __formal) Line 182 + 0x9 Bytes
WinGame.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy(bool _Built, unsigned int _Newsize) Line 1998
WinGame.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() Line 755
WinGame.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int CmdShow) Line 60 + 0x3c Bytes
WinGame.exe!__tmainCRTStartup() Line 547 + 0x2c Bytes
WinGame.exe!WinMainCRTStartup() Line 371