PDA

View Full Version : compilation with sdl, joystickuse



jhowland
3rd May 2010, 20:41
I am trying to use SDL within my qt code on windows, using minGW. When I include "SDL/SDL.H in my main window, I get an error "main redefined"--since SDL #defines main as SDL_main and QT (in qwindowdefs.h" #defines main as "qmain'.

Others have apparently solved this problem, since they claim to be using SDL to talk to joystick devices within QT--

http://www.batcom-it.net/?p=59

http://www.fredemmott.co.uk/blog/2009/07/23/Accessing%20joysticks%20with%20Qt



but I cant seem to get this to work, despite rearrangement of .h files, etc. Any tips, links, pointers? There are lots of references on the web describing the problem, but none that I have found that describe a solution.

Ultimately, of course, all I really want to do is use a joystick within QT--if there is an easier way than SDL, I'd be just as happy to completely avoid the problem

Nasamit
25th August 2010, 09:41
maybe you can delete the line in SDL_main.h, or like this
//#define main SDL_main

it work for me