SDL2.dll 在 QT (QJoystick) 中找不到 -lSDL2

SDL2.dll not found -lSDL2 in QT (QJoystick)

我在 windows 和 MinGW 编译器中使用 QJoystick 库。我在 QTCreator 工作。

我将其添加到 project.pro 文件中:

include (./3rdparty/QJoysticks-master/QJoysticks-master/QJoysticks.pri)

我只包括 #include <QJoystick>。 如果我是 运行 代码,我会遇到以下错误:

:-1: error: skipping incompatible [path]rdparty\QJoysticks-master\QJoysticks-master\lib\SDL\bin\windows\mingw/SDL2.dll when searching for -lSDL2
:-1: error: skipping incompatible [path]rdparty\QJoysticks-master\QJoysticks-master\lib\SDL\bin\windows\mingw/SDL2.dll when searching for -lSDL2
:-1: error: cannot find -lSDL2

我的项目结构是这样的:

test3
    |-test3.pro
    |-main.cpp
    |-[headers, and other cpp]
    \-3rdparty
        \-QJoysticks-master
            \-QJoysticks-master
                |-QJoysticks.pri
                |-QJoysticks.pro
                |-[readme and etc]
                \-lib
                    \-SDL
                        |-SDL.pri
                        \-bin
                            \-windows
                                \-mingw
                                    |-SDL2.dll
                                \-msvsc
                                    |-SDL2.dll
                            \-mac
                              .
                              .
                              .
                        \-include
                            |-SDL_[xyz].h
                            |-[other SDL[...].h]
                \-src
                    |-QJoysticks.h
                    |-QJoysticks.cpp
                    \-QJoysticks
                        |-[QJoysticks headers]

我是 C++ 初学者。

谢谢!

我的英语不是很好,抱歉。

问题可能是32位sdl2库版本问题。只需访问网站 http://libsdl.org/download-2.0.php,然后下载 x64 版本并替换“...\QJoysticks\lib\SDL\bin\windows\mingw”

中的 SDL2.dll 文件