Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Building Allegro 4.4.3 on Windows - CMake errors

This thread is locked; no one can reply to it. rss feed Print
Building Allegro 4.4.3 on Windows - CMake errors
Andrew Gillett
Member #15,868
January 2015

I get the following when I click Configure in CMake-GUI:

Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.17763.
CMAKE_RC_COMPILER: C:/Program Files (x86)/Embarcadero/Studio/20.0/bin/rc.exe
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Could NOT find DDRAW (missing: DDRAW_INCLUDE_DIR DDRAW_LIBRARY)
Could NOT find DINPUT (missing: DINPUT_INCLUDE_DIR DINPUT_LIBRARY)
Could NOT find DSOUND (missing: DSOUND_INCLUDE_DIR DSOUND_LIBRARY)
Could NOT find DXGUID (missing: DXGUID_LIBRARY)
CMake Error at CMakeLists.txt:603 (message):
DirectX required for Windows port. You might need to add DirectX include
and lib directories to your INCLUDE and LIB environment variables.

I have set the following environment variables but this makes no difference:

INCLUDE="C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um"

LIB="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17134.0\um\x86"

DXGUID_LIBRARY="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17134.0\um\x86\dxguid.lib"

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

CMake isn't finding the correct DX headers and libraries. You have to specify them manually, and Program Files is the wrong location. You need to use your compiler's headers and libraries. For MinGW-W64, this is in /mingw/i686_blah/include and /lib.

Andrew Gillett
Member #15,868
January 2015

Can Allegro 4 be built with MSVC? I can't find any instances of the DirectX headers and libs outside of Program Files\Windows Kits.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Andrew Gillett
Member #15,868
January 2015

The Windows 10 SDK is installed.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Allegro 4.4 was built way before the Windows SDK came out. You need to manually specify the include folders and lib folders and archive files that you need to use. I don't know where Windows keeps the SDK, a quick google should settle that.

raynebc
Member #11,908
May 2010

https://liballeg.org/old.html has what I've been using with MinGW.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

ZoriaRPG
Member #16,714
July 2017
avatar

I get the following when I click Configure in CMake-GUI:

If you manage to get it working with MSVC, please post a link to your project files, and any notes on what you needed to do. I haven't done it in a while, and I may need to rebuild at some point soon; and provide a tutorial for others in the future.

Also, note that the DX SDK that you need is an older one. The newer SDK dropped a few files, IIRC, that are required. I believe that I had to use DX SDK February 2010.

I can upload that for you, if you need it.

Honestly, can we get some MSVC project files into the core repo? A set for 2008 and 2015 would be grand.

Andrew Gillett
Member #15,868
January 2015

I have installed the Feb 2010 DirectX SDK. To get CMake configure to work, I had to add the lib and include dirs to my PATH. I received the following warning but it doesn't seem to matter:

CMake Warning (dev) at cmake/Common.cmake:52 (add_executable):
Policy CMP0037 is not set: Target names should not be reserved and should
match a validity pattern. Run "cmake --help-policy CMP0037" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
The target name "test" is reserved or not valid for certain CMake features,
such as generator expressions, and may result in undefined behavior.
Call Stack (most recent call first):
tests/CMakeLists.txt:12 (add_our_executable)
This warning is for project developers. Use -Wno-dev to suppress it.

Before clicking Generate, I unchecked WANT_ALLEGROGL, WANT_JPGALLEG, WANT_LOGG, and WANT_LOADPNG. I could then load build\allegro.sln and build everything successfully - the only exception being the 'scrsave' project.

UPDATE: In order to get alplatf.h, I had to add allegro\build\include to my Additional Include Directories, in addition to the usual allegro\include

raynebc
Member #11,908
May 2010

You shouldn't use the minimal dxsdk unless you're using an old version of vanilla mingw. Mingw-W64 comes with Dx.

I'm using actual MinGW instead of MinGW-w64. Does a contemporary version of the former even come with DirectX libraries and headers built-in?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

raynebc
Member #11,908
May 2010

You mean MinGW then. MinGW-w64 is a completely different compiler.

ZoriaRPG
Member #16,714
July 2017
avatar

You'd need the 32b version of MinGW for Windows. Compiling as 64b will not work properly.

Go to: