Ошибка Access violation reading location при конфигурации Release x64, в Debug x64 все работает

Пишу игру на библиотеке sfml-2.5.1 64bit на visual studio 2019, в свойствах проекта пути для библиотек sfml прописаны, в папку игры закинул все необходимые .dll файлы.

Пробовал обновлять пакеты visual c++, в debug конфигурации дополнительные зависимости .lib прописаны с -d, в release без приставки.

Когда использую конфигурацию запуска Debug x64 программа собирается и запускается без ошибок, при попытке запустить Release х64(при сборке Release x64 ошибок нет, но при запуске .exe файла появляется белый экран и потом вылетает) пишет следующее:

'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Users\sasha\source\repos\gameofthrones\x64\Release\sfml-audio-2.dll'. Module was built without symbols.
'ZombieArena.exe' (Win32): Loaded 'C:\Users\sasha\source\repos\gameofthrones\x64\Release\sfml-system-2.dll'. Module was built without symbols.
'ZombieArena.exe' (Win32): Loaded 'C:\Users\sasha\source\repos\gameofthrones\x64\Release\sfml-graphics-2.dll'. Module was built without symbols.
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Users\sasha\source\repos\gameofthrones\x64\Release\sfml-window-2.dll'. Module was built without symbols.
'ZombieArena.exe' (Win32): Unloaded 'C:\Users\sasha\source\repos\gameofthrones\x64\Release\sfml-window-2.dll'
'ZombieArena.exe' (Win32): Loaded 'C:\Users\sasha\source\repos\gameofthrones\x64\Release\sfml-window-2.dll'. Module was built without symbols.
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\glu32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Users\sasha\source\repos\gameofthrones\x64\Release\openal32.dll'. Module was built without symbols.
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\AppXDeploymentClient.dll'. 
'ZombieArena.exe' (Win32): Unloaded 'C:\Windows\System32\AppXDeploymentClient.dll'
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\c0346830.inf_amd64_f723e13ffb3b2652\B345901\atig6pxx.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\c0346830.inf_amd64_f723e13ffb3b2652\B345901\atio6axx.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\dxva2.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\c0346830.inf_amd64_f723e13ffb3b2652\B345901\atig6txx.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\atiadlxx.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\propsys.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\wintrust.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\wldp.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\DXCore.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\dinput8.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\InputHost.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\CoreUIComponents.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\hid.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\TextInputFramework.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\MMDevAPI.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\AudioSes.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\umpdc.dll'. 
'ZombieArena.exe' (Win32): Loaded 'C:\Windows\System32\ResourcePolicyClient.dll'. 
Exception thrown at 0x00007FFFEDAF146C (vcruntime140.dll) in ZombieArena.exe: 0xC0000005: Access violation reading location 0x0000009C20100000.
Unhandled exception at 0x00007FFFEDAF146C (vcruntime140.dll) in ZombieArena.exe: 0xC0000005: Access violation reading location 0x0000009C20100000.

The program '[11124] ZombieArena.exe' has exited with code 0 (0x0).

Программа останавливается когда доходит до:

    sf::SoundBuffer hitBuffer;
    hitBuffer.loadFromFile("sound/hit.wav"); // Вот здесь

Когда комментирую останавливается на следующей загрузке звукового файла. Если
комментирую все загрузки звуковых файлов останавливается на:

    sf::Text hiScoreText;
    hiScoreText.setFont(font);
    hiScoreText.setCharacterSize(30);
    hiScoreText.setFillColor(sf::Color::White);
    hiScoreText.setPosition(1000, 0);
    std::stringstream s; 
    s << "Hi Score:" << hiScore;
    hiScoreText.setString(s.str()); // Вот здесь


Ответы (1 шт):

Автор решения: Александр Куликов

Исправил, в свойствах проекта C/C++ -> Preprocessor -> Preprocessor Definitions нужно было прописать NDEBUG для Release конфигурации

→ Ссылка