Allegro.cc Forums » Off-Topic Ordeals » Hellows

 Edgar Reynaldo Member #8,592 May 2007 Hey Xavier, let me help you out a bit.First you need to pick a compiler that matches your version of allegro (whether it's for 4 or 5). Second download the binaries. Since you're going with CB and MinGW I suggest you start out with my pre-made binaries from here :Simply extract the folders anywhere you like. Generally you move the mingw folder to c:\mingw to make it easier for codeblocks and other programs to find your compiler.Next you need to setup either your command line or your CB project (do not use the global compiler, it just mixes and messes everything up).First I'll show you how to compile with a simple command line :Here's a simple list of commands to use with gcc :-I path\to\include\dir-L path\to\lib\dir-l$NAME where$NAME is libNAME.a, -o \$OUTPUTFILENAME-g (add in debugging symbols)-O[0-3] (ie. -O1) optimize from 0 (none) to 3 (lots)-c output only object files-Wall turn on all warnings-Wextra turn on extra warnings-Werror stop on errors (usually not very helpful)Anytime you open a command shell, you'll need to set your %PATH% variable to include c:\mingw\bin or wherever you installed MinGW. You can do that with :c:>set path=c:\mingw\bin;%PATH%c:>set pathThe second command will output the current path. You can also change your system environment variable PATH to do the same thing if you want it to be permananent.In CodeBlocks go to Menu->Project->BuildOptions and click on the overall project button in the top left. Then select search directories and set the compiler and linker search directories to match those of your allegro distribution that you are using (ie. from the binaries I provided, in the \include and \lib folders. You also need to set the linker settings (for the libraries that you need to link to) here :Compiler Search Directories{"name":"610945","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/2\/f28c2d7e98ef59a6c8ea033eb235d79f.png","w":744,"h":424,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/2\/f28c2d7e98ef59a6c8ea033eb235d79f"}Linker Search Directories{"name":"610946","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/1\/119f8a26416d8aeb73c4241312b2b57c.png","w":744,"h":424,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/1\/119f8a26416d8aeb73c4241312b2b57c"}Linker Settings{"name":"610947","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/b\/2bee17cd67ba42461170e7e550ec8e0f.png","w":744,"h":424,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/b\/2bee17cd67ba42461170e7e550ec8e0f"}After that you'll need to add files to your project by using Menu->Project->Add Files or Menu->File->New File. Then build and run the project as necessary, fixing compiler errors as you go.There are more advanced things, but those are the basics. I'll see if I can't get this up on the wiki. The page up there for codeblocks and mingw is like 10 years out of date. xD