Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Help getting Allegro 5 and Dev-C++ to work together on 64 bit Windows 7 machine

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Help getting Allegro 5 and Dev-C++ to work together on 64 bit Windows 7 machine
BletchleyPark
Member #18,406
September 2020

Is there a complete, coherent guide anywhere that explains how to add Allegro 5 libraries to Dev-C++ (version 5.11) and get those libraries to work on a 64 bit Windows 7 machine? I am at my wit's end trying to stitch together information that is outdated and incomplete. Thanks.

Bob Keane
Member #7,342
June 2006

Do you have to use Dev-C++? Allegro is fairly simple to install with Code::Blocks. You just need to make sure the binaries match your compiler.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

BletchleyPark
Member #18,406
September 2020

I don't have to use Dev-C++, but would prefer to avoid learning a new IDE if it isn't necessary. Having said that, I installed Code Blocks on my machine and successfully compiled non-Allegro code with it. However, I am now having the same problem with Code Blocks I was having with Dev-C++. The specific details of telling Code Blocks that the Allegro libraries exist and how to find them are described too vaguely to be of any use to someone who has no prior knowledge of the IDE. For example, one instruction says, "Put such and such path in the compiler search options." Since the location of the compiler search options isn't given, I have to guess where it is and what needs to go there. Am I having problems because I guessed wrong, or did I get it right and the problem lies elsewhere? I don't know, and I will be dead of an aggravation provoked stroke before I can run down the hundreds of things it could possibly be through trial and error.

So if you would be kind enough to walk me through the process, or point me to the guide that makes the process as simple as you say, I would appreciate it. Otherwise, I will abandon coding and take up something less aggravating, like organic chemistry. ;D

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Well, there used to be a really nice wiki page for CB and Allegro 5. But the wiki died and it hasn't been replaced yet. :(((( :-/

Seriously, use CB, it's much better than Dev-C++.

I can tell you how to do it all.

First leave your global compiler options alone. You said you have a working non allegro program. That's good. That means your compiler works.

Next, to use Allegro 5, you have to have binaries that match the compiler you're using. You can use the official binaries, or I have some for Allegro 5.2.5 if that's recent enough for you.

Next step, for any application, make a new project. Menu->File->New->Project.

Then at any time the project is active, you can go to Menu->Project->Properties or Build Options. This is where you set everything up. In Build Options, select the global project on the left and go to search directories on the right. Add in the compiler search directory for the allegro includes here. Add in the linker search directory for the allegro libs under the linker tab.

Then under each project type, select the linker options on the right, and add the allegro libraries here.

Project properties let you set things like gui/console, output executable, runtime working directory, and more.

dthompson
Member #5,749
April 2005
avatar

Did anybody take a dump of the old wiki? I just checked and it redirects straight to the new one - not sure when that started happening.

When I was on my 'sabbatical' I had a stab at porting as many of the articles as possible, but I didn't (and still don't) have time to do it all, so I'm afraid I had to prioritise newer, more relevant info :(

______________________________________________________
Website. It was freakdesign.bafsoft.net.
This isn't a game!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Rodolfo Lam
Member #16,045
August 2015

They are still available on the Wayback Machine. That’s the only copy I’ve found of the old MediaWiki site.

BletchleyPark
Member #18,406
September 2020

To the best that I have been able to determine, I am using a binary compatible with my system/compiler. I followed your instructions to the letter, and the compilation failed with 25 error messages, each an "undefined reference" to an allegro specific function. This is the same result I have been getting for as long as I have tried to get Allegro to work.

Over the course of failing to solve this problem with Code Blocks, a curious issue came up. Dev-C++ requires that the user inform the compiler about include files, and the linker about lib files, in a manner similar to CB. However, Dev also has a tab that is used to provide a search path to the bin files, while CB does not, or at least not that I could find. What are the bin files used for?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Then under each project type, select the linker options on the right, and add the allegro libraries here.

{"name":"612601","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/e\/8ea6a92ff4740a135a5b52086956861c.png","w":920,"h":750,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/e\/8ea6a92ff4740a135a5b52086956861c"}612601

BletchleyPark
Member #18,406
September 2020

The error message now is "No such file or directory."

I might simply be too stupid to make this work.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Did you add the lib directory to the search options in the linker tab?

Did you add the include directory to the search options under the compiler tab?

Where are your library files?

Bob Keane
Member #7,342
June 2006

My Allegro files are in my Documents folder. Here are a few screenshots:

Under the search directories:

Compiler include directories:

{"name":"612608","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/6\/06f17926724156a6c9a198df57657656.png","w":752,"h":739,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/6\/06f17926724156a6c9a198df57657656"}612608

If you press the add key at the bottom, you should get a dialogue box to navigate to the folder.

Then hit the linker tab to bring up the linker search directories:

{"name":"612609","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/1\/f1a3e27aab89f60d698dd2681c26f7a3.png","w":752,"h":739,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/1\/f1a3e27aab89f60d698dd2681c26f7a3"}612609

Same thing with the add button for the dialogue box. Friendly tip: If you want to link statically, copy and paste this list to the "other linker options" box under the linker settings tab:

-lallegro_monolith-debug-static
-ljpeg
-ldumb
-lwebp
-lFLAC
-ltheora
-lvorbisfile
-lvorbis
-logg
-lphysfs
-lfreetype
-lpng16
-lzlibstatic
-ldsound
-lgdiplus
-luuid
-lkernel32
-lwinmm
-lpsapi
-lopengl32
-lglu32
-luser32
-lcomdlg32
-lgdi32
-lshell32
-lole32
-ladvapi32
-lws2_32
-lshlwapi
-lpthread

Probably should ask, when you downloaded Code::Blocks, you got the version without the compiler, correct?

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

BletchleyPark
Member #18,406
September 2020

The enclosed screenshots reflect the state of Code Blocks on my machine after following Mr. Reynaldo's advice. In the linker settings, I did not include the Eagle debugging flags because I don't have anything like that on my machine that I know of. The specific library name used in that box reflects the closest equivalent in the bin folder. While Mr. Reynaldo's advice said that I could ignore the global settings and use the project settings instead, the screenshots here show global settings. I tried it both ways; neither way worked.

I haven't followed Mr. Keane's advice yet, but to answer his question, the version of Code Blocks I downloaded did include (I assume) the GNU GCC compiler seen in Compiler Settings.

Perhaps after you've reviewed the screenshots, we will have a better idea of where we are.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Here's an example project. You'll have to change the search directories.

Example.cbp.

And none of this matters if the compiler you're using doesn't match the binary version of allegro.

Bob Keane
Member #7,342
June 2006

I think I see the problem. CodeBlocks is using the prepackaged compiler.

Try pointing to the Allegro compatible compiler in the compiler installation directory:

{"name":"612618","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/f\/bff3159b11ea453b30c52a97a02f96e3.png","w":754,"h":739,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/f\/bff3159b11ea453b30c52a97a02f96e3"}612618

Also, use the "..." buttons on the C and C++ compiler lines to find the gcc.exe and g++.exe files in the same directory. And compare the other settings in my list to yours.

I am assuming you installed the Allegro mingw compatible compiler in a separate folder from CodeBlocks\MINGW.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

BletchleyPark
Member #18,406
September 2020

I haven't done anything with Mr. Reynaldo's example file yet. I thought I would try Mr. Keane's advice regarding the compiler first. Still not working. The enclosed screenshots show the compiler path and settings, and the version of Allegro I am using.

Bob Keane
Member #7,342
June 2006

Can you take a screen shot of your C:\MINGW folder please? There is something I'm not seeing. Also, use the formatting help button to show your images in your posts. First, click on the drop attachments button, then upload the file, copy the link location by right clicking the file and selecting copy link location, then type the quote marks are necessary. Allegro is having problems.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

BletchleyPark
Member #18,406
September 2020

{"name":"612623","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/2\/42a691072d67c251b299bb2de590424f.png","w":626,"h":306,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/2\/42a691072d67c251b299bb2de590424f"}612623

It took seven screenshots to capture the entire bin folder. In the interest of saving bandwidth, I will upload something more specific when you have determined what you need and let me know.

Thank you, and Mr. Reynaldo, for your help.

Bob Keane
Member #7,342
June 2006

Okay, thanks. Can you upload the contents of the bin folder please? I'm still not seeing what I am looking for.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

BletchleyPark
Member #18,406
September 2020

{"name":"612624","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/0\/00a58ae6cbbef9da17af2a81f40b0a76.png","w":1204,"h":856,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/0\/00a58ae6cbbef9da17af2a81f40b0a76"}612624

{"name":"612625","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24b3983cd7d2950af1c020ffc5edf34b.png","w":1204,"h":856,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24b3983cd7d2950af1c020ffc5edf34b"}612625

Bob Keane
Member #7,342
June 2006

I compared your bin folder to mine and I did not see some files which I have. This leads me to believe code::blocks is using the wrong compiler. Try deleting your C:\MINGW folder, and delete any downloaded compilers to avoid confusion. Then download this compiler, unzip it to C:\MINGW (you probably will need to recreate the folder). Don't use the autodetect feature in code::blocks to find the compiler. Use the "..." button to drill down to the folder containing the gcc.exe and g++.exe files. If that does not work, you may need to remove code::blocks, download the version without the compiler and reinstall. Here is a link to the Allegro files I use. They are compatible with the compiler. Just in case you need them. Uploads are failing, or the files I'm uploading are too big. I believe the code::blocks version you need is this one.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

BletchleyPark
Member #18,406
September 2020

{"name":"612626","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/a\/bac0a82a2d30d5e2567893910fef5cf3.png","w":500,"h":500,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/a\/bac0a82a2d30d5e2567893910fef5cf3"}612626
{"name":"612627","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/a\/6ab400f1626161e37d0eb81083148ee6.png","w":500,"h":500,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/a\/6ab400f1626161e37d0eb81083148ee6"}612627

This is the state of things now.

Bob Keane
Member #7,342
June 2006

I noticed you have "allegro-i686-w64-min32gw-gcc-9.2.0-po..." in your downloads, is that the version you are using? They may not be compatible with your compiler. Try deleting the Allegro files you are using and download the ones I linked. I've never done dynamic linking, so I am not sure what the linker options should be.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

BletchleyPark
Member #18,406
September 2020

The link you supplied for the Allegro files downloaded the files for the compiler instead.

Bob Keane
Member #7,342
June 2006

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

 1   2   3 


Go to: