I updated my files from SFML 1.6 to 2.0. The program worked okay before; after making some necessary modifications because of the new code, my first run crashes.
Call stack:
ntdll.dll!76eb69e0()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> Mindjob.exe!sf::priv::MutexImpl::Lock() Line 52 + 0xc bytes C++
Mindjob.exe!sf::Mutex::Lock() Line 62 C++
Mindjob.exe!sf::Lock::Lock(sf::Mutex & mutex) Line 39 C++
Mindjob.exe!sf::GlResource::GlResource() Line 53 + 0xd bytes C++
Mindjob.exe!sf::Image::Image() Line 52 + 0x47 bytes C++
Mindjob.exe!std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,sf::Image,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,sf::Image> > >::operator[](const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Keyval) Line 215 + 0xb bytes C++
Mindjob.exe!mj_file_cabinet::mj_file_cabinet() Line 7 + 0x3e bytes C++
Mindjob.exe!`dynamic initializer for 'cabinet''() Line 20 + 0x28 bytes C++
Mindjob.exe!_initterm(void (void)* * pfbegin, void (void)* * pfend) Line 873 C
Mindjob.exe!_cinit(int initFloatingPrecision) Line 288 + 0xf bytes C
Mindjob.exe!__tmainCRTStartup() Line 262 + 0x7 bytes C
Mindjob.exe!wmainCRTStartup() Line 189 C
kernel32.dll!75a91194()
ntdll.dll!76ecb429()
ntdll.dll!76ecb3fc()
The code in question (if I'm reading the call stack right):
mj_file_cabinet::mj_file_cabinet() {
// load our images
// TODO: error handling
image_map["megaman"].LoadFromFile("Sprite Sheets\\x_cut.jpg");
image_map["platform_1"].LoadFromFile("Sprite Sheets\\platform_1.png");
image_map["platform_2"].LoadFromFile("Sprite Sheets\\platform_2.png");
//load our sounds
//TODO: error handling here too
sound_map["ground_collide"].LoadFromFile("Sounds\\Land.wav");
}
"image_map" is declared in the header as std::map<std::string, sf::Image>.
Any ideas?