Sdl and qt

hi
i use qt to create a project, and i include sdl in the project.(all are
under MS windows) And when i complile the project, a link error occurs:
SDLmain.lib(SDL_main.obj) : error LNK2005: _WinMain at 16 already defined in
qtmain.lib(qtmain_win.obj)
qt and sdl all define Win_Main. How can i use sdl in qt project?

X.C

http://www.eyou.com
–??? ??? ??? ??? ???..???

Don’t link against qtmain.lib. Try to see if this works :slight_smile:

----Original Message Follows----From: sdlmail@eyou.com (xc)
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: [SDL] sdl and qt
Date: 15 Apr 2002 18:59:26 +0800
Received: from [66.224.24.122] by hotmail.com (3.2) with ESMTP id
MHotMailBE83FF0E006D4004310C42E0187ADBFA0; Mon, 15 Apr 2002 04:05:59 -0700
Received: from localhost.localdomain ([127.0.0.1]
helo=twomix.devolution.com)by twomix.devolution.com with esmtp (Exim 3.22
#2)id 16x4DO-0003Rd-00; Mon, 15 Apr 2002 04:00:06 -0700
Received: from [61.136.62.74] (helo=eyou.com)by twomix.devolution.com with
smtp (Exim 3.22 #2)id 16x4Cl-0003RJ-00for sdl at libsdl.org; Mon, 15 Apr 2002
03:59:27 -0700
Received: (qmail 25121 invoked by alias); 15 Apr 2002 18:59:25 +0800
Received: from unknown (HELO eyou.com) (61.136.62.70) by 61.136.62.74 with
SMTP; 15 Apr 2002 18:59:25 +0800
Received: (qmail 97383 invoked by uid 65534); 15 Apr 2002 18:59:26 +0800

From sdl-admin at libsdl.org Mon, 15 Apr 2002 04:06:18 -0700
Message-ID: <20020415185926.97382.qmail at eyou.com>
Sender: sdl-admin at libsdl.org
Errors-To: sdl-admin at libsdl.org
X-BeenThere: sdl at libsdl.org
X-Mailman-Version: 2.0.5
Precedence: bulk
X-Reply-To: “xc”
List-Help: <mailto:sdl-request at libsdl.org?subject=help>
List-Post: <mailto:sdl at libsdl.org>
List-Subscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=subscribe>
List-Id: A list for developers using the SDL library. (includes
SDL-announce) <sdl.libsdl.org>
List-Unsubscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=unsubscribe>
List-Archive: http://www.libsdl.org/pipermail/sdl/
X-Original-Date: 15 Apr 2002 18:59:26 +0800

hi
i use qt to create a project, and i include sdl in the project.(all are
under MS windows) And when i complile the project, a link error occurs:
SDLmain.lib(SDL_main.obj) : error LNK2005: _WinMain at 16 already defined in
qtmain.lib(qtmain_win.obj)
qt and sdl all define Win_Main. How can i use sdl in qt project?

X.C

http://www.eyou.com
–??? ??? ??? ??? ???..???


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

???V?I?T?A?L?I?Y???


Chat with friends online, try MSN Messenger: http://messenger.msn.com

hi
i use qt to create a project, and i include sdl in the project.(all are
under MS windows) And when i complile the project, a link error occurs:
SDLmain.lib(SDL_main.obj) : error LNK2005: _WinMain at 16 already defined in
qtmain.lib(qtmain_win.obj)
qt and sdl all define Win_Main. How can i use sdl in qt project?

You need to modify the Qt WinMain() to call SDL_RegisterApp() with the
main application module handle, and then don’t link with SDLmain.lib.

Please let me know if this works!

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment