Domkrt
Domkrt

Reputation: 85

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.

Upvotes: 1

Views: 569

Answers (1)

Piotr W
Piotr W

Reputation: 26

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"

Upvotes: 1

Related Questions