|
Installing allegro 5 on MVSC 2010 |
Inquisiteur
Member #12,428
December 2010
|
Hi all, I have beginner/intermediate knowledge in coding using Dev-C++. I thought this compiler was very user friendly, however now I am willing to move to something more "standard" and I installed Microsoft Visual C++ 2010. Most of my knowledge was coding using the Ncruses library, quite ugly interface but very straightforward for displaying stats in console mode. Anyway, I have installed MVSC 2010, downloaded allegro 5, copy pasted all files where they should go. However, when I take any example such as the one displayed here: when I hit the compile button I have the following errors: 1>------ Build started: Project: Allegro_testrun, Configuration: Debug Win32 ------ I have linked the following libraires to no avail: Can anyone provide guidance, I have been looking for hours now. Thx. |
Matthew Leverton
Supreme Loser
January 1999
|
If you link to the static libraries, you need to do this: #define ALLEGRO_STATICLINK #include <allegro5/allegro.h> (Or you can put that #define in your project settings.) Oh, and you want to link to the allegro- ... library too. The main one is not what you think it is. |
Thomas Fjellstrom
Member #476
June 2000
|
You also need to link to the core allegro library, not just allegro_main. -- |
Inquisiteur
Member #12,428
December 2010
|
Thank you for your kind answers. Is the core library included in the file I have downloaded from here ? or is it another .zip file ? |
Matthew Leverton
Supreme Loser
January 1999
|
It is in there. For release mode, it's easiest to use the monolithic, static, mt version. That's the only Allegro library you'd need to link with. (Additional Windows libraries like winmm.lib, opengl32.lib, glu32.lib, and psapi.lib would have to be explicitly added to the list.) Otherwise, you need to link with allegro, allegro-main, and any add-on that you use. |
Michał Cichoń
Member #11,736
March 2010
|
Core is just allegro-5.0.0-RC2-*.lib. I suggest you to use allegro-5.0.0-RC2-monolith-*.lib as Matthew said. "God starts from scratch too" |
Inquisiteur
Member #12,428
December 2010
|
I think it is working now, thank you all very much for your help. |
Matthew Leverton
Supreme Loser
January 1999
|
To make things less daunting, I'll probably add a secondary minimal package on a.cc's file page. e.g., allegro-min-5.0.0-rc2-msvc-10.0.zip would contain:
Michał, would anything else be needed? (I'm just using your binaries.) |
Michał Cichoń
Member #11,736
March 2010
|
You need to include all other static libraries for dependencies like libFLAC, libOgg and others found in archive. Also for MSVC pdb files will be importand while linking to debug version (linker complain when they are missing). Matthew, I can configure my script to prepare both: full and monolith (aka min) packages. People looks confused with naming and amount of files included, so also I will add README file. "God starts from scratch too" |
Matthew Leverton
Supreme Loser
January 1999
|
Michał Cichoń said: Also for MSVC pdb files will be importand while linking to debug version If they don't have the source code, the debug version isn't very useful. (The asserts might still be helpful.) Also, somebody who doesn't understand how to link with the various libraries, probably won't understand how to debug anyway... In fact, I'm not even sure I'd package the -md builds in it. Quote: I can configure my script to prepare both: full and monolith (aka min) packages ... so also I will add README file. I already have a script that unarchives the packages to modify them and put them in zips. (They were 7z's on the allegro5 site.) So I was going to just create the minimal archives then and insert a readme. So it doesn't really matter to me if you do it or not. Regarding the readme, I was just going to keep it very minimal. Something like: Allegro 5.0.0 for MinGW 4.5 See http://www.allegro.cc/manual/5/install/windows.html for installation instructions. (The URL might change before 5.0.0 is released.) |
Michał Cichoń
Member #11,736
March 2010
|
PDB are there to shut up the linker, that's the main reason if you do not have sources. Good point with README. I think a copy of this site should be included in case of offline usage. There is an error in this site: allegro[_module]-[version][-static,-monolith]-[mt,md][-debug] Should be: allegro[_module]-[version][-static][-monolith]-[mt,md][-debug] Because monolith version can be compiled as DLL. "God starts from scratch too" |
Matthew Leverton
Supreme Loser
January 1999
|
Michał Cichoń said: Good point with README. I think a copy of this site should be included in case of offline usage. The main reason I like to avoid including the docs directly with the archive is that the docs are sometimes updated (particularly configuring an IDE) after the archives are created. If people download the archive and leave them sitting around, they are more apt to read from old documentation. Those who know they will be installing offline, could just save or print out the relevant pages: the main one, and the one specific to their IDE. |
Michał Cichoń
Member #11,736
March 2010
|
So I think URL should be exposed in README with statement "For more recent doc see: url". Off-line version dumped at package creation time may still be included bellow it for quick reference. That's not of course the must. "God starts from scratch too" |
|