Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Libraries Conflict, SDL and Qt
QtWS25 Last Chance

Libraries Conflict, SDL and Qt

Scheduled Pinned Locked Moved 3rd Party Software
5 Posts 2 Posters 4.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fjctp
    wrote on 7 Jul 2013, 08:14 last edited by
    #1

    Hi,

    I tried to use SDL to access my joystick and use Qt for GUI. However, I got this error when I compile the code.

    SDLmain.lib(SDL_win32_main.obj):-1: error: LNK2005: _WinMain@16 already defined in qtmaind.lib(qtmain_win.obj)

    I am using Qt 5.1.0 and SDL 1.2.15

    Thank you

    @
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = joystick_GUI
    TEMPLATE = app

    LIBS += -L"C:/libs/SDL-1.2.15/lib/x86" -lSDL -lSDLmain

    INCLUDEPATH += C:/libs/SDL-1.2.15/include

    SOURCES += main.cpp
    joystick_gui.cpp
    joystick.cpp

    HEADERS += joystick_gui.h
    joystick.h

    FORMS += joystick_gui.ui
    @

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on 8 Jul 2013, 08:05 last edited by
      #2

      Hi, I am not familiar with SDL, but you can give a try to add following lines to your pro file, then run qmake

      @
      CONFIG-=windows
      QMAKE_LFLAGS += $$QMAKE_LFLAGS_WINDOWS
      @

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fjctp
        wrote on 8 Jul 2013, 16:39 last edited by
        #3

        That works! but do you mind explain to me what each line does?

        Thank you

        The other way around is removing qtmain from build.
        @
        QMAKE_LIBS_QT_ENGTRY =
        @

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dbzhang800
          wrote on 9 Jul 2013, 03:46 last edited by
          #4

          Ok, I write a blog right now.

          http://blog.debao.me/2013/07/link-confilict-between-sdl-and-qt-under-windows/

          hope it's useful for you.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fjctp
            wrote on 9 Jul 2013, 05:51 last edited by
            #5

            Your blog is very informative, thank you so much!

            1 Reply Last reply
            0

            2/5

            8 Jul 2013, 08:05

            • Login

            • Login or register to search.
            2 out of 5
            • First post
              2/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved