Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Fresh Windows 10 install and now I am eager to try installing Allegro again

This thread is locked; no one can reply to it. rss feed Print
Fresh Windows 10 install and now I am eager to try installing Allegro again
Tyler Wrobel
Member #16,594
November 2016

Hi, so my hhd crashes and I installed Windows 10 on an SSD now. I was trying really hard to install allegro and failed previously. Before I had alot of silly stuff in my Program files because GTAV installed like 3 extra Windows SDKs and I was not able to properly resolve paths and stuff like that. Was super noob at the time. I am now ready to actually do this. I have got a clean install of Windows and I am going to make this my programming laptop now so less headache. Can someone please volunteer to walk me setting up Allegro so that it actually works. I am ready to accept guidance on everything, need help picking a compiler, and etc. I've got a complete clean slate here.

bamccaig
Member #7,536
July 2006
avatar

I'm not even sure where the best binary distributions are made available anymore (the community shrunk by the time Allegro 5 was released and most people got busy with life). Looks like ML has 5.0.10 in the files section. Isn't SiegeLord producing 5.1.x binaries?

First you need to figure out your toolchain. Usually the options are MinGW/MSYS (GCC) or Visual Studio. You can setup a free IDE like Code::Blocks or DevCPP to use the MinGW toolchain, or you can learn to use the command line directly. I've heard that MSYS2 is much easier for actually building things, but I think it's still a bit of a pain to build all of Allegro's dependencies so you will likely want to find a binary distribution... Likely you'll need to pick your toolchain based on whatever Allegro was built with when targeting Windows to make sure they're compatible. Once you actually have the toolchain installed installing Allegro should be pretty simple. Mostly there's only a few steps:

1. Extract the Allegro files somewhere.
2. Configure your toolchain or IDE to find Allegro files.
* You need to specify an "include" directory where Allegro's header files are.
* You need to specify where the Allegro libraries are (e.g., DLL files).
3. Finally, link your toolchain/project to the Allegro library and include the Allegro headers.

Once we figure out where to get the best Allegro distributions and which toolchain you need we can go from there... :-/

Chris Katko
Member #1,881
January 2002
avatar

If I could make a recommendation, as a Windows user and professional Windows app developer...

Get Linux in a virtual machine. (VMWare Player is free. Then you just feed it an Ubuntu ISO and you're up and running.)

Programming is so much more awesome on Linux.

Want Allegro?

Type in a terminal:

sudo apt-get install allegro5

DONE. This won't likely be the newest version, however.

Want the BRAND newest version of Allegro?

Type in a terminal:

 git clone https://github.com/liballeg/allegro5.git

You've now got the source of the most recent Allegro in whatever directory you were in. Now, go in there, cd allegro5 or whatever. Run

./configure
make
make install

configure checks to make sure you have all required system dependencies.
make builds it. (You can use make -j 2 to use two cores, or 4, etc to build faster.) make install installs it into your system folders so you can link to it without it being in your directory.

BOOM. HEADSHOT. Every bug that's been fixed in github, is now fixed on your installation.

Of course, this won't be for everyone. And maybe it won't suit you. But if you've ever been on-the-fence about Linux, I REALLY encourage you to try it while you're at it. I use Ubuntu every day on my netbook, for work and fun, and work on Allegro games. I don't regret learning it at all, and the tools and mindset I've learned from cross-training has helped me solve problems on Window as well.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

bamccaig
Member #7,536
July 2006
avatar

Errrr, pretty sure those build instructions won't work for Allegro. ;) Allegro 4.4 and 5 use cmake as their build system. The build instructions are more like:

mkdir build
cd build
cmake ..
make
make install

In any case, it is definitely much easier to get going with Linux, but the virtual machine might throw some hardballs your way in terms of performance. If you have the space and ambition, installing a dual-boot setup is generally the easy button, but there is obviously a lot of time lost switching between OSes. In time though, you may find that you don't need one of them. ;) OK, that's enough cheer-leading.

Still trying to work out the Windows distribution situation...

SiegeLord
Member #7,827
October 2006
avatar

Aside from the VM, the easiest way to use Allegro on Windows is to install Visual Studio 2017 and then follow this tutorial: https://wiki.allegro.cc/index.php?title=Windows,_Visual_Studio_2015_and_Nuget_Allegro_5

You could also use the MinGW/MSYS based approaches, but they are somewhat more involved. I'd just go with MSVC and move on to the other options once you've got more experience under your belt.

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

Tyler Wrobel
Member #16,594
November 2016

I am really trying to stick to Windows for now. As for Visual Studio, I choose to do everything on the command line. I don't like Visual Studio.

bamccaig
Member #7,536
July 2006
avatar

I commend you for that. That said, as somebody that is mostly command line and has also had a professional career in mostly Windows I can say that Windows' command line options are really bad. It's the kind of thing that you cannot easily master, and even if you did, it would still be terrible. :D But I'm going to assume that you mean you intend to use MinGW/MSYS/MSYS2, not like Visual Studio's command line tools. :)

I'm a little disappointed though. I thought we had an acceptable answer. And now I'm left scratching my head wondering where to get up-to-date MinGW-based Allegro binaries again... :-/

Append:

Perhaps this is the place to be. Edgar is good people. You can trust him. And it looks like he walks you through getting the right toolchain too. Start with that and update us on where it leaves you.

Tyler Wrobel
Member #16,594
November 2016

Ok, I will. And also to note, last time I was trying to use Mircosoft Visual build tools (i.e. the native x64 command line compiler with the intel equip linker(the most recent version.) I am just trying to understand now that should I be using the MinGW compiler to compile my projects if I am using MinGW to build? Because, I didn't have really any problems compiling other than the Micrsoft Visual compile couldn't find the recursive directories of some follow up headers after the initial one, so that shouldn't be a problem with the MinGW because the system will already have the path I am assuming?

torhu
Member #2,727
September 2002
avatar

You have the "standard" include paths that are part of the compiler's configuration and contain standard library headers, etc. And then you can add more directories to the search path using either command line flags[1][2], or environment variables[3][4]

Tyler Wrobel
Member #16,594
November 2016

So these include paths will be set up for allegro5 if I use the MinGW compiler?

Polybios
Member #12,293
October 2010

I'd say the quickest way to install a working environment of Allegro 5 is to use msys2 (and their version of MinGW). They have a package manager through which you can also many of the dependencies. However, I'll have to admit that setup can be a bit more involved, as you'll have to setup the msys2 environment first and then find your way around their pacman package manager.

Tyler Wrobel
Member #16,594
November 2016

https://wiki.allegro.cc/index.php?title=Building_with_msys2

I was working from this one before, is this one you mean? So, this time I should just follow this and then use MinGW?

Edgar Reynaldo
Member #8,592
May 2007
avatar

MSYS2 is an option for MinGW, yes, but you could just use my MinGW and Allegro 5.2.2 binaries if you wanted. All you have to do is extract twice using 7-zip and then set your path and include directories.

Note : There is currently some small bug in the distro where ttf files won't load from physfs archives.. Not sure why that is happening.

Tyler Wrobel
Member #16,594
November 2016

Will this ttf thing be a problem if I want to try to build this thing later today?

Edgar Reynaldo
Member #8,592
May 2007
avatar

It should only be a problem if you want to load ttf files from a mounted physfs archive like a zip file. If you load them separately they work fine. If you try to load them from within the archive it fails.

All you need is 7-zip, and to get MinGW and Allegro 5.2.2 from here :

https://www.allegro.cc/forums/thread/616785

Polybios
Member #12,293
October 2010

I was working from this one before, is this one you mean? So, this time I should just follow this and then use MinGW?

I've revised the article. Since I somehow missed that I can't edit the wiki currently, I've posted my revised version here.

Tyler Wrobel
Member #16,594
November 2016

TIME 04/01 10:43 EST
I finally realized how to compile c++ with msys, the version I had of msys before my computer crashed must have been a different distro, this is where I am at...

I am trying to compile this https://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Displays example code

it looks like this...
#include <stdio.h>
#include <allegro.h>

int main(){

ALLEGRO_DISPLAY *display = NULL;

if(!al_init()) {
fprintf(stderr, "failed to initialize allegro!\n");
return -1;
}

display = al_create_display(640, 480);
if(!display) {
fprintf(stderr, "failed to create display!\n");
return -1;
}

al_clear_to_color(al_map_rgb(0,0,0));

al_flip_display();

al_rest(10.0);

al_destroy_display(display);

return 0;
}

I am running
MyDesktop@MSI MINGW64 /c/users/MyDesktop/documents/heap/Programs/allegro5
$ g++ allegrodisplay.cpp -I c:/msys64/mingw64/include/allegro5 -o adx.exe

and getting this...

C:\msys64\tmp\ccpsquRm.o:allegrodisplay.cpp:(.text+0x22): undefined reference to `al_install_system'
C:\msys64\tmp\ccpsquRm.o:allegrodisplay.cpp:(.text+0x69): undefined reference to `al_create_display'
C:\msys64\tmp\ccpsquRm.o:allegrodisplay.cpp:(.text+0xbf): undefined reference to `al_map_rgb'
C:\msys64\tmp\ccpsquRm.o:allegrodisplay.cpp:(.text+0xdb): undefined reference to `al_clear_to_color'
C:\msys64\tmp\ccpsquRm.o:allegrodisplay.cpp:(.text+0xe0): undefined reference to `al_flip_display'
C:\msys64\tmp\ccpsquRm.o:allegrodisplay.cpp:(.text+0xf5): undefined reference to `al_rest'
C:\msys64\tmp\ccpsquRm.o:allegrodisplay.cpp:(.text+0x101): undefined reference t o `al_destroy_display'
collect2.exe: error: ld returned 1 exit status

Also trying with Ubuntu in a Virtualbox but it says E: Unable to locate package allegro

Go to: