Code::Blocks Help
Fworg64

EDIT::EDIT:: Ok, well now i ungot it

Okay I've been trying to configure Allegro5 (rc4) to work with Code::Blocks for a good while now, I had given up for a while but have little to do this weekend so i thought id try to pick it up again.

What I want:
To be able to compile allegro5 programs with ease and comfort.

What is happening:
Limited to no success.

What I've Done:
Downloaded the correct binaries for my compiler Mingw4.4.0 (4.4.1?).
Placed the big folder (allegro-5.0.0-rc4-mingw-4.4.0) in my Mingw folder (C:\Program Files\CodeBlocks\MinGW)
Followed these steps:
. Go to Settings / Compiler and Debugger / Global compiler settings
. Go to Search Directories tab
. Under Compiler, add c:\allegro\include
. Under Linker, add c:\allegro\lib
. Go to Toolchain Executables tabs
. Under Additional Paths, add c:\allegro\bin //dont worry i used its actual folder not the imaginary one in my root.

gone to project>>build options>>linker settings>> add>> allegro-5.0.0-rc4-mingw-4.4.0\lib\liballegro-5.0.0-RC4-monolith-mt.a

Code I tried to compile:

#SelectExpand
1#define ALLEGRO_STATICLINK 1 2#include <allegro5/allegro.h> 3 4int main(void) 5{ 6 al_init(); 7 8 ALLEGRO_DISPLAY *display = al_create_display(640, 480); 9 10 al_clear_to_color(al_map_rgb(0, 150, 0)); 11 12 al_flip_display(); 13 14 al_rest(5); 15 16 return 0; 17} 18END_OF_MAIN()

and it gave me the following errors:
main.cpp||In function 'int main()':|
main.cpp|8|warning: unused variable 'display'|
main.cpp|18|error: expected constructor, destructor, or type conversion at end of input|

What I think I need to do:
Play around and link some magic things to some other things.

Additional Information:
OS: Windows Vista (ugh)
CB version: svn 6900

Question:
What settings do I need to change specifically? please. :D

Thank You for your time, I know this issue has been addressed multiple times. :-[

AMCerasoli

1 - Paste the Binaries into Mingw Directory, Not just the allegro-5.0.0-rc4-mingw-4.4.0 folder, but what it is inside... It should ask you if you want to merge some folders or something like that and you must say yes.

2 - Download "dx9mgw.zip" located at:
http://trent.gamblin.ca/dx/dx9mgw.zip
and paste it in the Mingw Directory. It also should ask you to merge some folder, say yes..

3 - Add this Environment Variable to the "path" system variable: C:\codeblocks\mingw\bin; (attention with the semi-colon, must be there)

4 - Make a new Environment Variable, a System Variable, named MINGDIR, and give it the value: C:\codeblocks\mingw.

To do so... Go to: Start > Control Panel > Advanced System Settings > Advanced > Environment Variables.

{"name":"variable.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/4\/f4c7fd3199990805a5aee5f8247cb797.gif","w":1180,"h":712,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/4\/f4c7fd3199990805a5aee5f8247cb797"}variable.gif

The image is just a reference... Do what I said above: use C:\codeblocks\mingw\bin; and C:\codeblocks\mingw. instead of C:\Mingw\bin and C:\Mingw

5 - Run the Code::Blocks program.
-Click Settings->Compiler And Debugger->Toolchain executables. Click Auto-Detect for the compilers installation directory.
A message should appear saying, (Auto-detected installation path of "GNU GCC Compiler" in "C:\codeblocks\mingw"). Click OK. Click OK again.

6 - Create new Project

7 - Empty project

8 - {"name":"empty.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/a\/0a90ce97fb7d81546915087e980491f6.gif","w":630,"h":530,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/a\/0a90ce97fb7d81546915087e980491f6"}empty.gif

9 - File > New > Empty File > Yes > Save > OK...

10 - Settings > Compile And Debugger > Linker Settings

And link there all the Allegro Dlls...

{"name":"lol.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/9\/e9191937e7d8f6d81b4f6caafface395.gif","w":1920,"h":1080,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/9\/e9191937e7d8f6d81b4f6caafface395"}lol.gif

That's it...

The next step is to create Crysis 5... ;)

Edgar Reynaldo
Fworg64 said:

and it gave me the following errors:
main.cpp||In function 'int main()':|
main.cpp|8|warning: unused variable 'display'|
main.cpp|18|error: expected constructor, destructor, or type conversion at end of input|

The error on line 18 is because you used END_OF_MAIN(), don't use end of main with Allegro 5, it's only for Allegro 4.

Thread #606012. Printed from Allegro.cc