Building Allegro 5 with dependencies (MSVC)
Andrew Gillett

I have built the dependency package as found here:
https://github.com/liballeg/allegro_winpkg/releases

I copied the built libs into allegro\deps\lib

On configuring with cmake-gui, I get:

Found Freetype: C:/Coding/allegro5.src/deps/lib/freetype.lib (found version "2.8.0") 
Performing Test TTF_COMPILES
Performing Test TTF_COMPILES - Failed
Performing Test TTF_COMPILES_WITH_EXTRA_DEPS
Performing Test TTF_COMPILES_WITH_EXTRA_DEPS - Failed
CMake Warning at addons/CMakeLists.txt:137 (message):
  FreeType doesn't compile.  Disabling support.

In CMakeError.log (attached) there are lots of errors like this:

freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_create_read_struct referenced in function Load_SBit_Png [C:\Coding\allegro5.src\build\CMakeFiles\CMakeTmp\cmTC_43fb5.vcxproj]

Edgar Reynaldo

{"name":"612570","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/b\/1bb001d00b762a2e45ed6b6b8c541da9.png","w":874,"h":495,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/b\/1bb001d00b762a2e45ed6b6b8c541da9"}612570

Check FREETYPE_PNG and FREETYPE_ZLIB

Then regenerate

Andrew Gillett

The project now generates. I also had to switch to the 64 bit DirectX libs as it autodetected the 32 bit ones.

Next issue is allegro_image fails to build:

2>C:\Coding\allegro5.src\deps\include\zconf.h(477,14): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

Arthur Kalliokoski

Try changing those backslashes in the path to forward slashes.

SiegeLord

How did you obtain include\zconf.h?

Andrew Gillett
SiegeLord said:

How did you obtain include\zconf.h?

Now that you mention it, I have no idea. I replaced the includes with the ones from your package and now it builds successfully.

Edgar Reynaldo

Quick question why aren't you using the nougat package?
8-)

Andrew Gillett

Quick question why aren't you using the nougat package?

I need to incorporate several changes for my game:

- The fix for "3rd party controller: crash while enumerating buttons, and corrupt instance name" https://github.com/liballeg/allegro5/issues/1156

- A fix or workaround for "Joystick lag" https://github.com/liballeg/allegro5/issues/1026

- Fix or workarounds for these issues which I've just submitted -
"Get an XInput controller's actual name?" https://github.com/liballeg/allegro5/issues/1171
"DirectInput controller button names numbered from 0" https://github.com/liballeg/allegro5/issues/1172

- Raise maximum number of DirectInput joysticks – currently 8, but my game technically supports up to 100 players. Highly unlikely to ever be reached or even approached in practice, but I may try for a high number of simultaneous players if I take my game to a show.

- Enable use of shader model 3 https://www.allegro.cc/forums/thread/618238

Edgar Reynaldo

Oh, my my. You really do need cutting edge allegro. You know there's a way to link to dlls or make dlls into .lib files.

Andrew Gillett

When I built Allegro, I noticed that CMake selected the February 2010 DirectX SDK instead of the June 2010 one. Does this matter? The main difference I'm aware of is that the June one does not include ddraw.lib, which was needed for Allegro 4.

On the interface for Steamworks, there is a page for selecting redistributables which can be installed alongside your game. It has an option for DirectX June 2010, but not February, which perhaps indicates that I can't guarantee that an end-user will have the correct version of DirectX installed. On the other hand, perhaps this option is for old Windows XP machines, and more modern versions of Windows always have old DirectX versions installed by default?

Edgar Reynaldo

Even XP had version 9 of DirectX. It will run from XP on.

Thread #618241. Printed from Allegro.cc