简体   繁体   中英

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

I'm using the QJoystick library in windows and MinGW compiler. I'm working in QTCreator.

I add it to the project.pro file:

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

And I just include #include <QJoystick> . And if I'm running the code, I have this errors:

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

My project struct is this:

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]

I'm beginner in C++.

Thanks!

My English isn't perfect, sorry.

The problem may be caused by 32-bit sdl2 library version. Just go to the website http://libsdl.org/download-2.0.php then download x64 version and replace the SDL2.dll file in "...\QJoysticks\lib\SDL\bin\windows\mingw"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM