Results 1 to 2 of 2

Thread: compilation with sdl, joystickuse

  1. #1
    Join Date
    Sep 2008
    Location
    Falmouth, MA, USA
    Posts
    34
    Thanks
    4
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default compilation with sdl, joystickuse

    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/200...ks%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

  2. #2
    Join Date
    Aug 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: compilation with sdl, joystickuse

    maybe you can delete the line in SDL_main.h, or like this
    //#define main SDL_main

    it work for me

Similar Threads

  1. SDK vs. own compilation
    By codeman in forum Installation and Deployment
    Replies: 19
    Last Post: 20th October 2009, 10:50
  2. Compilation error wen using VTK in QT4.4
    By richardander in forum Qt Programming
    Replies: 3
    Last Post: 9th February 2009, 22:49
  3. Qt 4.4.0 compilation Error?
    By mismael85 in forum Installation and Deployment
    Replies: 7
    Last Post: 3rd July 2008, 09:59
  4. sub-dir compilation problem
    By Salazaar in forum Newbie
    Replies: 13
    Last Post: 2nd November 2007, 21:48
  5. Compilation without......
    By ball in forum Installation and Deployment
    Replies: 1
    Last Post: 28th January 2006, 21:31

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.