1

I have successfully installed allegro 4.2.3 in accordance with the instructions at the following link and it all works great:

http://blog.hamidnazari.com/2010/07/21/installing-allegro-on-visual-cpp-express-2010/

The only thing I've ended up deviating from in respect to the tutorial linked above, is I've selected Windows Application instead of Console Application where illustrated within the 3rd graphical example (note selecting between Win32 Console Application or Win32 Project as illustrated in the 2nd graphical example, I've found to make no noticeable difference so far).

Selecting Windows Application where illustrated in the 3rd graphical example, has for me at least, simply resulted in NOT Needing to include the line: #define USE_CONSOLE in all my Allegro programs.

Please in respect of the tutorial linked above and the title of this post, can someone please help me by answering the following question:

Start of Question: How can I get my Allegro games to work on other computers that use Windows, without the other computers requiring that Visual C++ 2010 Express be installed, And/Or the pre-built binary version of Allegro 4.2.3 (linked to in the above tutorial) also being required to be on the other computers and linked to/configured within Visual C++ 2010 Express, also described in the above tutorial. End of Question

Incidentally: A great link for anyone interested in making standard C++ programs (i.e. that don't use Allegro or other various libraries) work by having a fully independent .exe file (compiled/built using Visual C++ 2010 Express) which can indeed run on other computers using windows, is below:

http://www.youtube.com/watch?v=AvrjQtFBJvk

Thank you for taking the time to read this post and I hope very much that someone is able to help.

Gary.

My Reply To Matthews 1st Answer Is Below:

Hi Matthew,

I’ve been looking on Google to try and find out how the various elements you mention, fit in with and compare to the linked tutorial in my post which explains step by step how to configure visual C++ 2010 Express with the Allegro 4.2.3 binary.

The first thing I want to check with you, is if all the binaries in the 4.4.2 section and 4.2.3 section on the Allegro.cc site, are essentially both pre-built binaries, and therefore ultimately configuring version 4.4.2 to work with VC++ 2010 should be in principle similar to configuring version 4.2.3 (or perhaps not?) I have downloaded version 4.4.2 and can see that there are indeed the same 3 folders, bin, include & lib.

Here is the link again to the online tutorial which explains how to successfully configure step by step, Allegro 4.2.3 with visual C++ 2010 Express:

http://blog.hamidnazari.com/2010/07/21/installing-allegro-on-visual-cpp-express-2010/

Working through the steps in the above tutorial, I have noticed additional elements in your initial answer which I have listed below. (Please note, although the tutorial does indeed work well for version 4.2.3, simply selecting the release option instead of debug when building does not result in the .exe files working on other windows computers (although the .exe file in the release folder does still run on my primary computer), and so I guess there are other things that need to be done in addition to selecting release.

1) allegro-4.4.2-monolith-static-mt.lib --- Does this need to be added to additional dependencies in the Input Section within the Linker dropdown for both debug and release. (Also how does this compare with the tutorial for this part of the configuration i.e. are there any other additional dependencies)

2) link to all the various Win32 libraries when you static link --- I don’t know how to link to these libraries. I’m a bit stumped on this.

3) #define ALLEGRO_STATICLINK --- Does this mean that “ALLEGRO_STATICLINK” needs adding to the Preprocessor Section within the C/C++ dropdown, as I read somebody else did in an attempt to get it all working for 4.4.2

To conclude: I suppose to ask my initial question once again considering all that has been said so far, I would ask it in the following 2 parts:

Part 1) How would the online tutorial need adding to/modifying for static builds to work successfully on other computers using windows for version 4.2.3, and would this then just mean selecting the release build option and of course keeping together any files linked with the .exe when distributing.

Part 2) If using the 4.4.2 version, again how would the online tutorial need adding to/modifying for static and dynamic builds to work successfully.

Tutorial type answers to Part 1 or 2 would be awesome for me and many other newbies

Thank you very much indeed for reading this post.

2 Answers2

2

Allegro 4.2 is painfully old. You should use 4.4 at minimum. It is source compatible with 4.2 (same API) and still receives updates from time to time. Allegro 5 is where all the active development is now, but it has a completely new API. I still highly recommend that you take a look at it.

Anyway, to answer the question, yes, you need to static link. Grab a binary from here:

Link with the allegro-4.4.2-monolith-static-mt.lib file, and make sure you compile using the /MT switch (as opposed to /MD). The -static aspect means the Allegro DLL is not needed. the -mt flag means the C runtime is not needed.

You'll also need to link to all the various Win32 libraries when you static link. Also, be sure to #define ALLEGRO_STATICLINK in your project settings.

Matthew
  • 47,584
  • 11
  • 86
  • 98
  • Hello Matthew, Thank you for helping with this. I am very new to c++, Allegro and programming in general. I will have a go at what you suggest after work today in about 7 hours from now. I will have some extremely basic questions about the fundamentals of the overall installation/configuration process. I will update this post within the next 24 hours to let you no exactly where I'm at. Thank you once again. – user1831698 Jan 17 '13 at 09:04
  • Please Find My Reply To Matthews 1st Answer Added On To The End Of My Original Question At The Top Of The Page. Thank You Very Much. – user1831698 Jan 17 '13 at 19:56
  • StackOverflow isn't really designed to have a lot of lengthy back-and-forth communication. For that type of discussion, you should join the forums @ allegro.cc. This link might help: https://www.allegro.cc/forums/thread/609180. It's all the same sort of configuration, just with different library names. And yes, you can use the Preprocessor Section instead of `#define ALLEGRO_STATICLINK`. – Matthew Jan 18 '13 at 00:44
0

It's been a little while, but if I remember correctly there's an easy way to do this, though it's probably not the best way. It's good for just sending a little demo to a friend. Even if you just build in Debug mode, you can send the game over to other people. Copy/paste the allegro-4.2.2-monolith-md.lib file (Its name is something like that, but probably not that exactly) into the project's Debug folder (next to the .exe). You'll probably also need the MSVCR1000.lib file (or something like that. Can't remember the exact name), but you'll have to find that online somewhere.

DISCLAIMER: I've never used such a completely old version of Allegro, so this solution may not exactly be applicable. But I was using Allegro after version 5 and up to 5.6, so I know it works for newer versions. You should just use a newer version, really.

Shaquil Hansford
  • 383
  • 1
  • 2
  • 9