Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Installing and Using Allegro 5 with code::blocks

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Installing and Using Allegro 5 with code::blocks
AMCerasoli
Member #11,955
May 2010
avatar

And just so I understand exactly what I've been doing these past couple days there is no .exe in Allegro so really its not installed like that right. It is just a bunch of ones and zeros that the MinGW compiler reades so that c::b can use it for GUI when its called upon?

Well, I'm going to try my best, but my info is not 100% accurate. And my English sucks.

There is no .exe because Allegro does nothing by itself, instead it has a bunch of little functions, variables and struts to perform little task that together form an actual application/game.

We use to think about of program as "something" that needs to show something in our screen, but not always is that way, in fact the ~80% of processing doesn't have anything to do with your screen. What I'm trying to say is that your program could be called from another program without human intervention. Have ever wonder why do you use to type: `int main(int argc, char **argv)` in the main function?. As you can see your main function, where everything starts, it's just a simple function... Another function which is called by the OS. When you run your application/game, you have the possibility to send some arguments to it, just the same as when you call a function from your program. Obviously it's not exactly the same because the main function is a "special" function, that the OS call it knowing that it's going to start an application. But as you can see you can retrieve arguments and at the end return something, just as you do with a normal functions.

Obviously normally you just press double click on an program, and it opens, so you can't actually send anything to the program that way. But if you run your game from the command line, you can indeed send some parameter to your program, without needing to get input from the user inside your app.

so int argc is the amount of parameter you have passed to your program and `char **argv` it's an array which contains the actual information. You can read about it on the web, some of the Allegro examples uses these techniques.

So what is Allegro then?, well, Allegro it's like an executable that you program is opening and closing constantly. For example you call al_draw_bitmap(), you can think of it like a little program, that your program opens and do something, but it's not the main application, even when it does a lot of thing, it's not the main application, the main application is that from where you're calling those functions, and for that reason you application ends with .exe and allegro with .dll or when statically linked the content is already inside your game.

Quote:

should installing allegro really be as hard as I'm making it?

At all man... I don't know what is your problem, you must be really noob, and you're probably trying to run before knowing how to walk.

I don't understand very well the way Edgar is telling you how to do it now, so I can't help you anymore.

In pro of originality my boss asked me if I could create an original register form, and I answered "yes, of course". One of the main features it had was the ability to be really original with all your user fields, no repeated phone number, no repeated address, email, username, etc... The problem was when I added the same to the password, and I notified the user that the password he was introducing was already taken, and who was using it, some minutes after I was fired...

Edgar Reynaldo
Member #8,592
May 2007
avatar

i used the file path "bin" instead of "lib" like you said because I linked dynamically.

NO. bin is where the dlls are stored. A dll is NOT an object archive. You link to *.a files with MinGW, not *.dll. When you link to the dynamic archives, then your program depends on the dlls associated with those archives. So the correct linker flag would be -Lc:\allegro\lib. The -L flag says "tell the linker to look here" (for *.a files).

Quote:

The direction on the wiki were to use all the "bin" files that ended with "-md.dll" and thought that you just made an error when you gave me the value. After I created the key and value I put $(A5LIBS) in the "other linker options" in the global compiler settings and it did not work. Then I put it the build options > "other linker options" in my project and it still didn't work. I am getting the same error as before:

You have to use some of your own intelligence here, and not take everything so literally. Of course the values I gave you won't work, because they are for use with a self compiled version of allegro. You have to use the names of the libraries that came in your binary distribution of allegro.

Quote:

The files in my c:\allegro\bin I am using to link include:

Those look right. Just forget about the compiler variable for now. It was meant to make things easier on you in the future when you have more than one A5 project.

AND, as we told you before, COPY the allegro dlls into the SAME FOLDER as your executable. They will have the exact same naming scheme as the libraries you linked to did, but they will be named .dll instead, and they won't have a leading 'lib' on the beginning of the file.

C/C++ Reference -|- cplusplus.com - The C++ Resources Network -|- SGI's STL guide
Proverbs 15:33 The reverence of the LORD is the instruction of wisdom; And before honour is humility.
My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense)

the_get_man
Member #13,909
January 2012

Well guys thanks for everything but this is were I'm stopping before I drag this forum on any longer. I have done everything exactly as the instructions say and I cant get anything to work. I am going to try and see if my college professor can get this thing up and running and I let you guys know what steps he took if he can figure it out or what I was doing wrong.

AMCerasoli
Member #11,955
May 2010
avatar

I'm really sorry you couldn't install it, if you manage to do it and if you have the time, you could write here what you was doing wrong. If the thread is closed by that time, I'd really appreciate if you send me an allegro.cc private message to improve the tutorial in the section in which you had the problem, that way others don't have to go through the same you did.

In pro of originality my boss asked me if I could create an original register form, and I answered "yes, of course". One of the main features it had was the ability to be really original with all your user fields, no repeated phone number, no repeated address, email, username, etc... The problem was when I added the same to the password, and I notified the user that the password he was introducing was already taken, and who was using it, some minutes after I was fired...

Edgar Reynaldo
Member #8,592
May 2007
avatar

"The program can't start because allegro-5.0.5-monolith-md.dll is missing from your computer. Try reinstalling the program to fix this problem"

Dude, it's not that complicated. COPY THE DLL into your program's folder. I told you before, dependency walker will tell you exactly which dlls a program expects to have available at runtime.

C/C++ Reference -|- cplusplus.com - The C++ Resources Network -|- SGI's STL guide
Proverbs 15:33 The reverence of the LORD is the instruction of wisdom; And before honour is humility.
My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense)

Arthur Kalliokoski
Member #5,540
February 2005
avatar

Dude, it's not that complicated. COPY THE DLL into your program's folder.

In other words, what Edgar Reynaldo means is that windows will look in the current directory for executables and DLL's first, and if this is done by an installation program, then "Try reinstalling the program to fix this problem" will do it right the first time.

I really admire the U.S. Constitution. It's so much better than what we have now.

AMCerasoli
Member #11,955
May 2010
avatar

Wait a minute... "allegro-5.0.5-monolith-md.dll"??? Are you trying now the monolith version?.

Now seeing your previous post:

The files in my c:\allegro\bin I am using to link include:

allegro_acodec-5.0.5-md.dll
allegro_audio-5.0.5-md.dll
allegro_color-5.0.5-md.dll
allegro_dialog-5.0.5-md.dll
allegro_font-5.0.5-md.dll
allegro_image-5.0.5-md.dll
allegro_memfile-5.0.5-md.dll
allegro_physfs-5.0.5-md.dll
allegro_primitives-5.0.5-md.dll
allegro_ttf-5.0.5-md.dll
allegro-5.0.5-md.dll
allegro-5.0.5-monolith-md.dll <-- WTF

Aren't you, by chance, linking to the monolith version of Allegro too?, because if you're linking to all those libraries plus the monolith is not right. Read about it

In pro of originality my boss asked me if I could create an original register form, and I answered "yes, of course". One of the main features it had was the ability to be really original with all your user fields, no repeated phone number, no repeated address, email, username, etc... The problem was when I added the same to the password, and I notified the user that the password he was introducing was already taken, and who was using it, some minutes after I was fired...

 1   2 


Go to: