Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » -- Dev-C++ users, READ THIS! --

This thread is locked; no one can reply to it. rss feed Print
-- Dev-C++ users, READ THIS! --
Bob
Free Market Evangelist
September 2000
avatar

Here are my installation instructions for getting Dev-C++ and Allegro working together. It took me about an hour to download all the data, do the installation and write those instructions, so they should be easy to follow. I would appreciate any comments you have. I will bring the necessary modifications as they become needed.
code:
Dev-C++ instructions:
---------------------
These instructions are for Dev-C++ 4.00 and 4.01. They may or may not
apply to other versions.
If you happen to have Mingw, DJGPP or any other version of GCC
installed, then uninstall them. Dev-C++ will replace them from now on.
This step is required for getting Allegro to compile - we don't want
your DJGPP installation to conflict with Dev-C++'s. Don't worry,
you'll still have a fully functional gcc for Windows, and you can
always reinstall the other compilers if you don't need to compile
Allegro for Dev-C++.
1) Download the complete development package from
http://www.bloodshed.net/devcpp.html. Unzip it in a temporary
directory (such as C:\temp), and run setup.exe from there.
Select Typical install.
Install it in a directory of your choice, but make sure do not
use '+' in the name. For example, use Dev-Cpp instead of Dev-C++.
This step is required for getting the command line utils to
work properly. If you are running under Windows NT or 2000,
you will need administritive priviliges to complete the
installation.

Also download the latest Allegro WIP, and unzip it in a
directory of your choice (usually C:\Dev-Cpp\allegro)
2) Dev-C++ is based off the Mingw32 compiler, so to get Allegro
working, you'll need to update a few packages of Dev-C++.
Following this procedure will update the whole compiler to the
latest version of gcc (as of this writting).
Download the following packages:
1. http://prdownloads.sourceforge.net/mingw/MinGW-1.1.tar.gz
2. ftp://ftp.franken.de/pub/win32/develop/gnuwin32/mingw32/porters/Mikey/
fileutils316-ming.tar.bz2
3. http://sunsite.auc.dk/allegro/wipdll/dx70_mgw.zip
You may need to get a program to read the .gz and .bz2 files.
Power Archiver http://www.powerarchiver.com/ is recommended for
this task. WinRAR or WinZip will not work properly.
3) You should unzip all of them in your Dev-C++ directory. They will
overwrite the older files.

4) Now is the time to set up your path. If you're running Windows 95
or Windows 98, then open notepad, and edit your c:\autoexec.bat.
Add those lines at the end of the file:
SET PATH=C:\Dev-Cpp\bin;%path%
SET MINGDIR=C:\Dev-Cpp
Make sure you write the exact path of where you installed Dev-C++
in Step 1, and add \bin at the end of it. Reboot your computer for
the change to take effect.
If you're running Windows ME, you'll need to select "Run" off the
start menu, then type in "msconfig". Select the environment
tab, then make the changes as noted above.
Reboot your computer for the changes to take effect.
If you're running Windows 2000 (NT?), then open Control Pannel,
then the "System" applet, then the "Advanced" tab, and
finally the "Environment" button. Select the PATH= entry, and add
"C:\Dev-Cpp\bin" to it (without the quotes, and assuming you
installed Dev-C++ in C:\Dev-Cpp). Create a new environment
variable called MINGDIR and set it equal to "C:\Dev-Cpp" (again,
without the quotes). You will need to log off and log back in
for the changes to take effect.

Note: If at any stage, you get an "Out of Environment space"
message, then please see the Allegro FAQ for how to fix this.
5) Open a DOS prompt. This is done by running the comamnd:
C:\COMMAND.COM
(or cmd.exe for Windows 2000 and Windows ME). You can create a
shortcut to it on your desktop or start menu if you like.
Find your way to whereever you installed Allegro. Now's the time
to test your installation. Type "gcc -v" (without the quotes) at
the command prompt, followed by the <enter> key. You should see
something like this:
G:\Dev-Cpp\allegro>gcc -v
Reading specs from g:/dev-cpp/bin/../lib/gcc-lib/mingw32/2.95.3-6/specs
gcc version 2.95.3-6 (mingw special)
From now on, we're done setting up Dev-C++, and will now set up
Allegro (don't worry, it gets much easier)
6) At the DOS prompt you were in from step 5, type "fix mingw32"
(without the quotes), then type "make" and watch Allegro compile.
This may take a few minutes. Once Allegro is compiled, you'll need
to install it.
7) Installing Allegro is a simple matter of typing "make install" at
the command prompt.
Some poeple had trouble in this step, so you may need to manually
run SET MINGDIR=C:\Dev-Cpp before running make install.
Ok, now that Allegro is properly set up and installed, we can create
our first Allegro program (yay!)
8) Launch Dev-C++ and create a new project (File/New Project). Select
"Windows Application", then click on the "Ok" button. Name your
project and give associate it to a new file. You should now see a
sample code in a window. Close that window since you won't be
needing it (Allegro is much simpler to use than this). Create a
new file (File/New Source File), then write a small Allegro
program. You can inspire yourself by the Allegro examples if you
wish. Here's a small program you can type to see if everything
worked until now:
#include "allegro.h"
int main() {
allegro_init();
allegro_message("Hello World!");
return 0;
}
END_OF_MAIN();

9) You now need to tell Dev-C++ that you'd like to make a program
that uses Allegro. For that, go in the Project Options screen
(Project/Project Options menu), then click on "Load Object Files".
You need to select the file called liballeg.a (of liballd.a for
the debug mode); the file should be in C:\Dev-Cpp\lib. Notice
it's a .a file, and not a .o file, so you'll need to get the file
dialog to show all files.
10) Compile your project! Simply click on the green check mark on
your Dev-C++ toolbar. Correct any syntax errors in your code,
then click on "Execute" to run the program. If all worked
you will see a message box pop up with "Hello World" inside of it.
And we're done!
Recommended reading:
allegro.txt - The Allegro API, and main documentation
faq.txt - Frequently Asked Questions. There you will find
answers to most asked questions about Allegro
help.txt - How to properly ask for help, if ever you need to.

And most importantly, have fun!

[ October 25, 2001: Message edited by: Bob ]

--
- Bob
[ -- All my signature links are 404 -- ]

Bob
Free Market Evangelist
September 2000
avatar

Thoughts? comments?

--
- Bob
[ -- All my signature links are 404 -- ]

Matt Smith
Member #783
November 2000

I'll follow it word for word today and see what happens :)

Connelly Barnes
Member #1,329
May 2001

WinME notes:

WinME does require a restart. There is no 'Environment' tab under ControlPanel->System. To modify the Environment under WinME, select Start, Run, type "msconfig" (without quotes), and press Enter. Then select the Environment tab and continue as per Bob's instructions.

I think I'll avoid posting, because this 'Newbie' status will really piss me off. :-/. Well, that's what you get when you have a system that rewards idle gossip. Cya.

23yrold3yrold
Member #1,134
March 2001
avatar

You da man, Bob! Thanks!

No comments yet. I haven't tried installing this again since the last time, but I'm gonna give it a shot after work.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Bob
Free Market Evangelist
September 2000
avatar

Thanks Connelly. I'll make the necessary corrections.
And don't worry about the member status, no one really looks at it. We all have to start somewhere

--
- Bob
[ -- All my signature links are 404 -- ]

Goodbytes
Member #448
June 2000
avatar

Bob: You're going to merge this into readme.mgw, right?

I'm wondering if I should follow your instructions and do what it says there, because my Dev-C++ version of GCC is an older one, 2.95.2 I believe. Is it worth updating?


--
~Goodbytes

Bob
Free Market Evangelist
September 2000
avatar

I might get this merged into readme.mgw (or maybe it's own readme), but I need to make sure the instructions are clear and correct.

The compiler that comes with Dev-C++ is about a year and a half old (or something like that), this is why I'd recommend updating.

--
- Bob
[ -- All my signature links are 404 -- ]

Matthew Leverton
Supreme Loser
January 1999
avatar

Ok, I never have used Dev-C++ before so I thought I'd be a prime suspect for testing. I think rule 4.5 should ask them to Download the latest Allegro WIP and install it to "/Dev-Cpp/Allegro". An obvious step indeed, but one never knows...

Of course it didn't work for me though.... :) I get a message saying it cannot find "libbfd-2.10.91.dll" when I try to compile. I did a search on my PC for that file, and didn't find anything. What'd I do wrong?

Bob
Free Market Evangelist
September 2000
avatar

Matthew: could you post the entire message plus the command line that generated it?

And thanks for the help

Edit: Matthew, can you download and install this package and tell me if it fixed the problem?

[ August 31, 2001: Message edited by: Bob ]

--
- Bob
[ -- All my signature links are 404 -- ]

Matthew Leverton
Supreme Loser
January 1999
avatar

I'm running Windows 2000 with no previous copy of Dev-C, DJGPP or whatever. Error message upon compiling is:
"The dynamic link library libbfd-2.10.91.dll could not be found in the specified path: [my_path]"
Upon unzipping the package you mentioned above, everything worked fine and I was able to compile a "Hello World" via allegro.
The only other comment I have is you may want to supply a small working program such as:
code:
#include "allegro.h"
int main(int argc, char *argv[])
{
allegro_init();
allegro_message("Hello World");
return 0;
}
END_OF_MAIN()

so they can test if it works. You may be getting first time Allegro users that haven't read the documentation yet. The coolest thing is if you can follow rule-by-rule and have everything work. After they can see it works, they may be more apt to hit the books.

Bob
Free Market Evangelist
September 2000
avatar

Ok, I'll do that. Tell me, does the executable run without that DLL? I don't want to introduce unexpected dependencies.

--
- Bob
[ -- All my signature links are 404 -- ]

Goodbytes
Member #448
June 2000
avatar

Bob: I can confirm that your method works also with version 4.01 of Dev-C++.


--
~Goodbytes

Bob
Free Market Evangelist
September 2000
avatar

goodbytes: Confirmed. 4.01 only fixes bugs and adds features to the IDE; the rest of the system (compiler and such) are left intact from 4.00.

--
- Bob
[ -- All my signature links are 404 -- ]

Connelly Barnes
Member #1,329
May 2001

Allegro project templates are available here.
Simply unzip the above file into the C:\Dev-Cpp\Templates directory (or wherever you installed Dev-C++). Then whenever you select 'New Project', an Allegro tab will be available. Under the Allegro tab, you can select either a DLL or Statically Linked version of Allegro.
DLL Version: Uses all39??.dll, where ?? is the subversion of your Allegro WIP copy.
Static Linked Version: Makes an executable that does NOT require all39??.dll. The executable will be larger, but will still be significantly smaller than distributing both the Allegro DLL and your game's DLL-linked executable in one ZIP/GZIP file, if that's what you intend to do.
I will contact the Dev-C++ developer about including the Allegro project templates in the next version of Dev-C++. Feel free to come up with a better Allegro icon.
Enjoy!
- Connelly Barnes.
Bob: Microsoft code not only is O(n^20), but it also runs in a processor speed compensated environment. So 1 GHz is only twice as fast as 1 MHz...
[ September 01, 2001: Message edited by: Connelly Barnes ]
[ September 01, 2001: Message edited by: Connelly Barnes ]
[ September 01, 2001: Message edited by: Connelly Barnes ]

Mattias
Member #1,387
June 2001
avatar

Nice work, Bob.
Some notes:
It may be important to also notify that you need to uninstall (edit autoexec.bat) DJGPP, to get all versions of gcc off the path.
Lets add the Dev-C++ 4.01 update to that file-list for those who dont notice the updates link: http://www.bloodshed.net/dev/devcpp401.zip
Also, there is something called GCC 3.0-1 on the Dev-C++ Resource Site. Its version number is higher than current (2.95.3-6), but timestamp is only 20.06.2001. So is it a newer version or not?

23yrold3yrold
Member #1,134
March 2001
avatar

OK, I'm downloading it now (not everyone has a high-speed Internet connection, y'know :) ). Just wondering; I can remove that path crap from autoexec.bat when I'm done setting up, right? I don't thing Dev-C++ needs it, but my DJGPP does. Also just to clarify, I create a C:/DevCpp folder, unzip everything into that folder (not any sub folders) and then move make.exe from C:/DevCpp to C:/DevCpp/bin? I only ask because I remember getting confused the last time I tried this.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Mattias
Member #1,387
June 2001
avatar

Dev-C++ doesn't need the PATH settings, but command line MinGW does. So you need to set it after installing all the stuff and before compiling allegro. If you don't want to use command line mingw any more, the autoexec.bat can be restored.

Dont unpack devcpp4.zip into C:\DevCpp, but into any temporary folder because it contains install files. Others should be unpacked to C:\DevCpp (if thats where you installed it).

[ September 01, 2001: Message edited by: Mattias ]

Bob
Free Market Evangelist
September 2000
avatar

Mattias: Yes, gcc 3.0 is newer, but contains lots of bugs (a lot of code was changed since the 2.95 series), so it's not recommended to use unless you want to debug it :) I would wait for it stabilize before using the new compiler.

Ok, I'll mention DJGPP too. Thanks everybody!

--
- Bob
[ -- All my signature links are 404 -- ]

DanielH
Member #934
January 2001
avatar

Compiling Allegro for MINGW32, optimised. Please wait...
windres -O coff -o obj/mingw32/alleg/dibsound.res -i tests/win/dibsound.rc

  1. 1 "tests/win/dibsound.rc"

...
...
windres: no resources
C:\DEV-CPP\BIN\MAKE.EXE: *** [obj/mingw32/alleg/dibsound.res] Error 1

Bob
Free Market Evangelist
September 2000
avatar

DanielH: you got a clean copy of Allegro WIP 3.9.37?

--
- Bob
[ -- All my signature links are 404 -- ]

DanielH
Member #934
January 2001
avatar

I just downloaded 3.9.3.7 windows ready.
I installed each file in the same order as you said. I ran fix mingw32 and I still get the same error.
[ September 01, 2001: Message edited by: DanielH ]

Bob
Free Market Evangelist
September 2000
avatar

Is the error message exactly what you wrote?
I try again from the clean Allegro sources...

--
- Bob
[ -- All my signature links are 404 -- ]

Bob
Free Market Evangelist
September 2000
avatar

DanielH: Type make -v, then gcc -v, and post your complete version info here. I suspect 'make' isn't passing long arguments correctly. I have just tried both copies on SourceForge and the one from Allegro.c without any problems whatsoever, provided you followed the instructions I gave.

--
- Bob
[ -- All my signature links are 404 -- ]

23yrold3yrold
Member #1,134
March 2001
avatar

Why does w32api-1.0.1-20010726.tar.gz appear empty? It's got two folders; one with two dots and another with just one. I think I move the latter into C:/Dev-C++/, yes?

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.



Go to: