Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Building Allegro Git with Mingw-w64

This thread is locked; no one can reply to it. rss feed Print
Building Allegro Git with Mingw-w64
Erin Maus
Member #7,537
July 2006
avatar

Hey, I found an issue when building Allegro from Git with Mingw-w64. I don't think it's so much of an installation/configuration problem because the solution is pretty simple, but more so of a 'let's make this easier for the end-user' kind of thing.

Mingw-w64 includes GCC-compatible libraries and headers for DirectX (among other parts of the Windows SDK). Currently, Allegro's build system only looks for the official DirectX SDK, which results in the user having to manually specify each directory/library (e.g., dinput, dsound).

I can't fix it at the moment because the only CMake experience I have is executing the program on the command line! However, I assume it's in the FindD*.cmake files. Currently, the default include and lib directories are never searched, only directories specified by the DirectX SDK. I hacked a fix together to build Allegro on my end by including the default CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH into search paths for these files (I found it easier than manually specifying, what, five DirectX include/lib directories!).

I'll try and figure out a proper solution later if it turns out no one cares :p. But again, the only experience I have with CMake is using the command line program to build software.

---
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
they / she

SiegeLord
Member #7,827
October 2006
avatar

Are you describing a situation where you have the DirectX SDK installed and you're compiling with mingw? I'm pretty sure it picks up the mingw's DirectX headers just fine otherwise.

EDIT: And to be clear, what was the cmake invocation you used? What is typically done is doing: cmake -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw64/x86_64-w64-mingw32/ (or the 32 bit equivalent).

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Erin Maus
Member #7,537
July 2006
avatar

Ok, here is my cmake invocation so far after following your advice.

cmake ../allegro -G "MSYS Makefiles" -DCMAKE_INCLUDE_PATH=/c/MinGW/x86_64-w64-mingw32/include -DCMAKE_LIBRARY_PATH=/c/MinGW/x86_64-w64-mingw32/lib -DCMAKE_PREFIX_PATH=$ALLEGRO_BUILD_PATH -DCMAKE_INSTALL_PREFIX=$ALLEGRO_BUILD_PATH -DFREETYPE_INCLUDE_DIRS=$ALLEGRO_BUILD_PATH/freetype2:$ALLEGRO_BUILD_PATH/freetype2/config/ -DWANT_PHYSFS=OFF -DSHARED=OFF

Simply supplying /c/MinGW/x86_64-w64-mingw32/[lib,include] fixed it [that is the only thing different from my original invocation]... almost. Regardless, I feel stupid for posting this in development when it was obviously an installation issue.

Now it complains about being unable to find d3dx9. I understand this library has multiple versions that can be linked to... do I specify one of the versions manually, and if so, which version?

---
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
they / she

SiegeLord
Member #7,827
October 2006
avatar

For me, CMake found these:

//Path to a file.
D3DX9_INCLUDE_DIR:PATH=C:/msys64/mingw32/i686-w64-mingw32/include

//Path to a library.
D3DX9_LIBRARY:FILEPATH=C:/msys64/mingw32/i686-w64-mingw32/lib/libd3dx9.a

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Erin Maus
Member #7,537
July 2006
avatar

In the x86_64 directories, they're all libd3dx9_XX.a. I just made a symlink to one of the later ones and will test to see if it works. What parts of Allegro use d3dx9?

---
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
they / she

SiegeLord
Member #7,827
October 2006
avatar

Shaders and compressed textures. I don't think the exact version matters, but the dynamic loading in Allegro5 will try to load up until version 43.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Go to: