Skip to content

Commit

Permalink
Fix build on Windows
Browse files Browse the repository at this point in the history
The competition between Qt and SDL to redefine main() on Windows (for
portability purposes and the WinMain entry point for GUI applications)
ends up badly when Qt is included before SDL. Thus make sure to include
SDL before any other header.

See #1169.
  • Loading branch information
lmoureaux committed Aug 4, 2022
1 parent ea9fe79 commit 2edf4ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/gui_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
see https://www.gnu.org/licenses/.
**************************************************************************/

#include "mapview_common.h"
// Keep this first. In particular before any Qt include.
#ifdef AUDIO_SDL
#include <SDL2/SDL.h>
#endif // AUDIO_SDL
Expand All @@ -21,6 +21,7 @@
// client
#include "client_main.h"
#include "clinet.h"
#include "mapview_common.h"
#include "mapview_g.h"
#include "options.h"
#include "sprite.h"
Expand Down

0 comments on commit 2edf4ec

Please sign in to comment.