Allegro.cc - Online Community
Post Reply

Allegro.cc Forums » Allegro Development » Building Allegro 5 with dependencies (MSVC)

Credits go to Edgar Reynaldo and SiegeLord for helping out!
rss feed Print
Building Allegro 5 with dependencies (MSVC)
Andrew Gillett
Member #15,868
January 2015

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
Major Reynaldo
May 2007
avatar

{"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
Member #15,868
January 2015

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
Second in Command
February 2005
avatar

Try changing those backslashes in the path to forward slashes.

The only way Trump is going to be involved in a landslide is if the land surrounding the White House collapses into the Earth's core. -- bamccaig

SiegeLord
Member #7,827
October 2006
avatar

How did you obtain include\zconf.h?

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

Andrew Gillett
Member #15,868
January 2015

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
Major Reynaldo
May 2007
avatar

Andrew Gillett
Member #15,868
January 2015

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
Major Reynaldo
May 2007
avatar

Andrew Gillett
Member #15,868
January 2015

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?

Post Reply
Go to: