Mappy
allegro_newbie

hey,

im created a map using the program called Mappy which apparently works with allegro and am just trying to load my map at this point, according to the help file i need to do this:

++++++++++++++++++++++++++++++++++++++++++++

C++ notes: MappyAL will work fine with C++, but the file 'mappyal.c'
must be compiled as 'C'. With MSVC there is no problem as it uses
the filename extension (.c/.cpp) to determine how to compile, but
IDE's like DevC++ and VIDE don't do this with C++ projects, so
instead of adding mappyal.c to your list of sourcefiles (like with
MSVC) be sure you have mappyal.o by running 'buildal.bat', or
manually compiling with:

gcc mappyal.c -O2 -Wall -c -o mappyal.o

then adding mappyal.o BEFORE -lalleg in the linking options, with
DevC++ select Project:Project options (Alt+P) and click 'Load object
files' and add mappyal.o, now move the -lalleg text so it is after
the object file, it should look something like:
C:\mapalr11\mappyal.o -lalleg
do not add the file mappyal.c to your sourcefile list

++++++++++++++++++++++++++++++++++++++++++++

could anyone break this down for me because i still dont really understand it.. running "buildal.bat" doesnt do anything expect open up a screen then shut down about half a second later

LennyLen
Quote:

running "buildal.bat" doesnt do anything expect open up a screen then shut down about half a second later

I haven't use mappy before, but no doubt the batch file is just calling gcc to create the object file for you. Just do what it says about adding mappyal.o to your project when linking.

If you want to see what buildal.bat is dong, run it from a command promt instead of double-clicking it.

allegro_newbie

it wont compile if i add mappyal.o in the linker thingy, i dont even have that file to begin with.. i tried to create it by putting "gcc mappyal.c -O2 -Wall -c -o mappyal.o" in a text file and saving it as .o but it doesnt seem to do anything.. /bawl

LennyLen
Quote:

i tried to create it by putting "gcc mappyal.c -O2 -Wall -c -o mappyal.o" in a text file and saving it as .o but it doesnt seem to do anything.

That's not what an object (.o) file is, that's why.

You need to run that line (gcc mappyal.c -O2 -Wall -c -o mappyal.o) from the command-line. It creates the object file from mappyal.c for you to link with your projects.

allegro_newbie

i guess thats what im not understanding :P what is the command promt/command line? and how do i go about doing that?

LennyLen
Quote:

what is the command promt/command line?

Rough answer: It's a text-based console window, where you type in commands directly.

Quote:

and how do i go about doing that?

If you're running Windows XP, you can access the command prompt by hitting Windows-R and then typing cmd in the message box that opens.

Then you need to navigate to the folder you have the mappy files in. to change directories, you use the cd command. So if you have them in say "c:\programming\mappy", then you want to type in the following:

> cd c:\programming\mappy
c:\programming\mappy> gcc mappyal.c -O2 -Wall -c -o mappyal.o

You can replace the last line with:


c:\programming\mappy> buildal.bat

If your mappy directory is on a different drive (eg. D:\) then:

> d:\
d:\> cd programming\mappy
d:\programming\mappy> gcc mappyal.c -O2 -Wall -c -o mappyal.o

Since running buildal.bat didnt produce the object file the first time, running it again is probably going to give you an error (as will calling gcc directly no doubt). But at least now you'll be able to see the error, since it won't be displayed in a window that disappear sa split second later.

For versions of Windows other than XP, I'm not 100% sure how you bring up the comand promt (I think win9x uses command.exe instead of cmd.exe, and I have no idea about NT/win2k). Once you have a command prompt up and running though, the steps are the same.

allegro_newbie

thanks a bunch! ill try it out :)

(edit)

ugh, it claims it cant find this gcc file even though both files are in the same folder and i even opened up the buildal thingy in notepad and gave it the correct path for the gcc file

Thread #588643. Printed from Allegro.cc