MinGW64 can't find SDL2 for compilation

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
JackalDev
Posts: 2
Joined: September 15th, 2021, 7:32 pm

MinGW64 can't find SDL2 for compilation

Post by JackalDev »

Hey all,
I can't get MinGW64 to compile Wesnoth because the command can't find the SDL2 Library. I am running this command:

Code: Select all

 scons arch=native sdl2dir=/mingw64/\include/\SDL2 boostdir=/mingw64/\include/\boost boostlibdir=/mingw64/\bin boost_suffix=-mt
Following is the output about not being able to find SDL

Code: Select all

Checking for Simple DirectMedia Layer library version >= 2.0.4... no
Checking for SDL2_ttf library... no
Checking for SDL2_mixer library... no
Checking for SDL2_image library... no
Checking for C library vorbisfile... yes
Checking for Ogg Vorbis support in SDL... no
Checking for PNG support in SDL... no
Checking for JPG support in SDL... no
I have installed all of the dependencies via this command:

Code: Select all

pacman -S git scons mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-boost mingw-w64-x86_64-gcc mingw-w64-x86_64-glew mingw-w64-x86_64-openssl mingw-w64-x86_64-pango mingw-w64-x86_64-pkg-config
which I have copied from this helpful Guide

Following is all output:

Code: Select all

scons: Reading SConscript files ...
Building Wesnoth version 1.14.17+dev
Mkdir("build")
---[checking prerequisites]---
Checking for C library m... yes
Checking for C function round()... yes
Checking whether C++ compiler works (g++ version >= 4.8 required)... yes
Checking for Boost iostreams library version >= 1.50.0... yes
Checking for gzip support in Boost Iostreams... yes
Checking for bzip2 support in Boost Iostreams... yes
Checking for Boost random library version >= 1.50.0... yes
Checking for Boost smart_ptr library... yes
Checking for Boost locale library... yes
Checking for Boost system library... yes
Checking for Boost asio library... yes
Checking for Boost thread library version >= 1.50.0... yes
Checking for Boost filesystem library... yes
INFO: Base prerequisites are met
Checking for available Boost Locale backends... icu,winapi,std
Checking for C library libcrypto... yes
Checking whether compiler has built-in -D_FORTIFY_SOURCE... no
Checking for Simple DirectMedia Layer library version >= 2.0.4... no
Checking for SDL2_ttf library... no
Checking for SDL2_mixer library... no
Checking for SDL2_image library... no
Checking for C library vorbisfile... yes
Checking for Ogg Vorbis support in SDL... no
Checking for PNG support in SDL... no
Checking for JPG support in SDL... no
Checking for Cairo... (cached) yes
Checking for Pango with cairo backend... (cached) yes
Checking for fontconfig... (cached) yes
Checking for Boost program_options library version >= 1.50.0... yes
Checking for Boost regex library... yes
WARNING: Client prerequisites are not met. wesnoth cannot be built
WARNING: Unit tests are disabled because their prerequisites are not met
  If any config checks fail, look in build/config.log for details
  If a check fails spuriously due to caching, use --config=force to force its rerun
---[applying configuration]---
scons: done reading SConscript files.
scons: Building targets ...
error_action(["wesnoth"], [])
scons: *** [wesnoth] Target disabled because its prerequisites are not met
scons: building terminated because of errors.
Does anybody know how to fix this problem? Any help is appreciated.
User avatar
Pentarctagon
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: MinGW64 can't find SDL2 for compilation

Post by Pentarctagon »

https://forums.wesnoth.org/viewtopic.php?f=5&t=54009 is another thread where someone had some similar problems, so there might be a solution there.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
JackalDev
Posts: 2
Joined: September 15th, 2021, 7:32 pm

Re: MinGW64 can't find SDL2 for compilation

Post by JackalDev »

Thanks, but I've already pored over that wiki several times prior to my post; nothing in the post was able to help me. It's weird that MinGW64 can find Boost but not SDL. I've even tried uninstalling SDL and installing it again (with pacman).
User avatar
Antro
Translator
Posts: 70
Joined: February 11th, 2009, 3:53 pm

Re: MinGW64 can't find SDL2 for compilation

Post by Antro »

Succesfully compiled with:

Code: Select all

scons arch=native sdldir=/mingw64 boostdir=/mingw64/\include/\boost boostlibdir=/mingw64/\bin boost_suffix=-mt extra_flags_config="-I/mingw64/include/pango-1.0 -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -I/mingw64/include/harfbuzz -I/mingw64/include/cairo -I/mingw64/include/dbus-1.0 -I/mingw64/lib/dbus-1.0/include"
Post Reply