The Allegro Wiki is migrating to github at https://github.com/liballeg/allegro_wiki/wiki

Building Allegro 4.9/Installing 4.9 Windows

From Allegro Wiki
< Building Allegro 4.9
Revision as of 19:39, September 22, 2008 by Matt Smith (talk | contribs) (Installing 4.9 Windows moved to Building Allegro 4.9/Installing 4.9 Windows: similar dir structure to 4.4 build)
Jump to: navigation, search

Libs

To build Allegro 5 and all its add-on libs, you'll need to install the following libs for your compilers. Open a console and make sure the MING_DIR and MSCVDir environment variables are set

zlib and libpng (optional)

zlib is required if want PNG and/or TTF support

Download http://www.zlib.net/zlib123-dll.zip.

 copy zlib1.dll \windows\system32

msvc

 copy lib\zdll.exp %MSVCDir%\lib
 copy lib\zdll.lib %MSVCDir%\lib
 copy include\*.h  %MSVCDir%\include

mingw

 copy lib/zdll.lib %MING_DIR%\lib
 ren  %MING_DIR%\lib\zdll.lib libz.a
 copy include/*.h  %MING_DIR%\include    

mingw & msvc

Gnuwin32 have good precompiled binaries of libpng 1.2

Download http://heanet.dl.sourceforge.net/sourceforge/gnuwin32/libpng-1.2.7-bin.zip This contains bin/libpng.dll which you copy to \windows\system32

Download http://heanet.dl.sourceforge.net/sourceforge/gnuwin32/libpng-1.2.7-lib.zip which contains both mingw and vc libs

 copy include\* %MSVCDir%\include 
 copy include\* %MING_DIR%\include 
 copy lib\lib*  %MING_DIR%\lib
 copy lib\pkgconfig\libpng.lib %MSVCDir%\lib

freetype (optional)

Gnuwin32 Website : http://gnuwin32.sourceforge.net/packages/freetype.htm


Download : http://heanet.dl.sourceforge.net/sourceforge/gnuwin32/freetype-2.3.5-1-setup.exe and run it. Is this supposed to install in the compiler automatically? well it didn't for me. So, in C:\Program Files\GunWin32

 copy bin\freetype6.dll to \WINDOWS\System32 

msvc

 copy -r include\*  %MSVCDir%\include              ft2build.h and freetype dir
 copy lib\freetype.lib %MSVCDir%\include   

mingw

 copy -r include\*  %MING_DIR%\include             ft2build.h and freetype dir
 copy lib\libfreetype.dll.a  %MING_DIR%\lib
 copy lib\libfreetype6.def  %MING_DIR%\lib

d3d9 (optional)

mingw

http: http://trent.gamblin.ca/dx/

msvc

M$ DX SDK Download page:

Building

cmake 2.6

Web page: http://www.cmake.org/ Download page: http://www.cmake.org/cmake/resources/software.html

mingw

msvc

Open a console. Use either the Start-menu VS shortcut or manually run VCVAR32.BAT In your allegro dir, type

 misc/fixdll.bat
 cmake

to see the list of generators which should include your version of Visual Studio, and then (e.g.)

 cmake -G "Visual Studio 8 2005" -DSTATIC=ON -DSHARED=OFF

use -DSHARED=OFF if you do not have both Open GL and D3D9 libs installed, because they are both needed to build the DLL.

Now you should have 2 workspace/solution files in the root e.g. ALLEGRO.sln and BUILDALL.sln Open your dir in Explorer and open ALLEGRO.sln. This will start VS with all the Allegro libs and examples as projects. Build All. Enjoy the examples.

Now quit and install allegro+plugins for other projects

 copy lib\debug\*.lib %MSVCDir%\lib\ 
 mkdir %MSVCDir%\include\allegro5   
 xcopy include\allegro5\* %MSVCDir%\include\allegro5 /E

Now, write a game