• 下载SDL库

    下载地址:https://www.libsdl.org/ (我下载的是SDL2-devel-2.0.14-mingw.tar.gz (MinGW 32/64-bit))

    • 在*pro里配置SDL
      1. INCLUDEPATH+=C:/qtplayer/SDL2-2.0.14/x86_64-w64-mingw32/include
      2. LIBS+=C:/qtplayer/SDL2-2.0.14/x86_64-w64-mingw32/lib/libSDL2.dll.a \
      3. C:/qtplayer/SDL2-2.0.14/x86_64-w64-mingw32/lib/libSDL2main.a
      遇到的问题:
      程序运行时报以下错误
      11:42:19: F:\qt-code\build-qtplayer-Desktop_Qt_5_12_10_MinGW_64_bit-Debug\debug\qtplayer.exe crashed
      解决办法:
      将SDL2-2.0.14\x86_64-w64-mingw32\bin下的动态库拷贝到执行目录下