Building Allegro 4.4.3 on Windows - CMake errors
Andrew Gillett

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

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

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

Oh, sorry, I didn't notice you were using MSVC. You need the DirectX SDK, either Nov 2010 or later in the form of the Windows SDK.

Andrew Gillett

The Windows 10 SDK is installed.

Edgar Reynaldo

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

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

Edgar Reynaldo

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

ZoriaRPG

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

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

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

No, it doesn't. And it's not going to happen anytime in the near future either. The keyword was don't use them unless you were using old mingw.

raynebc

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

ZoriaRPG

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

Thread #617713. Printed from Allegro.cc