Jump to content
  • Advertisement
Sign in to follow this  
darenking

C++ ALLEGRO - can someone help me with the fblend library? (And update my Allegro?)

This topic is 4847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm very excited to read that fblend is "4 to 13 times faster than Allegro", as I'm kinda crazy about alpha sprites, and do find Allegro far too slow. But I'm having problems getting fblend examples to work. When I try to run an example (that comes with the library) I get a message, failed to start because alleg41.dll not found. I have version 4.9.9.1 of Dev C, with package version 4.0 of Allegro, which has alleg40.dll. Perhaps I need to install version 4.1 of Allegro, and that would have alleg41.dll? But I can't find a version 4.1 here: http://www.talula.demon.co.uk/allegro/wip.html In fact I find Allegro version numbers very confusing. Can anyone recommend which version of Allegro I should install? It needs to ideally be a package or something, as I'm not clever enough to compile a load of source files or whatever. And it needs to work with flbend, most importantly. It looks like fblend is very easy to use once installed, but I've never installed (if that is the correct term) a C++ library before. Do you just place the library folder in the right folder?

Share this post


Link to post
Share on other sites
Advertisement
Fblend is a C library that integrates nicely into Allegro. How did you get FBlend? You really should compile it for yourself so it matches your version of Allegro.

The 4.1.X series of Allegro is the development branch. That means it is newer than the 4.0.X series, but isn't guaranteed to be API compatible across the board. Distributing things that require the alleg41.dll is a big no no, because they aren't guaranteed compatible. So, I cannot tell you which alleg41.dll you need.

The reason you cannot find 4.1 anywhere is because 4.2 is coming out very soon. It's in "beta" right now, which means no more features will be added and it's just getting all the last bugs worked out. I would really recommend that you download the Allegro 4.2 beta 4 source and compile it for yourself. Then get the FBlend source and compile it. You'll be guaranteed that they are compatible that way.

Compiling Allegro is as easy as this:

SET MINGDIR=c:\mingw
fix mingw32
make all
make installall

Depending on your version of MinGW, you may need to use "mingw32-make" instead of "make".

Share this post


Link to post
Share on other sites
Thanks for your help...

I got fblend from here, I assume that's a good idea:

http://sourceforge.net/projects/fblend/

Quote:
Original post by konForce
Compiling Allegro is as easy as this:

SET MINGDIR=c:\mingw
fix mingw32
make all
make installall



Where do I type these commands? In the RUN box on the Windows start menu? I'm using Windows XP.

Do I uninstall the current Allegro first? Then put the folder with the new uncompiled version of Allegro somewhere or other then type the above commands?

Share this post


Link to post
Share on other sites
First get the latest Allegro 4.2 zip file. Unzip it to a clean location. C:\Allegro, or whatever you want.

You shouldn't have to uninstall anything before running these steps.

(I'm just guessing at the directory names. Correct them if need be.)

Open up a command prompt via Start / Run / cmd.exe.

  1. SET PATH=C:\dev-cpp\bin;%PATH%
  2. SET MINGDIR=c:\dev-cpp
  3. cd\allegro
  4. fix mingw32
  5. make all
  6. make installall


The folder in #1 should point to the bin directory that contains "gcc" and "make".
The folder in #2 should point to the directory that contains the "include" and "lib" folders.
The folder in #3 should be wherever you unziped Allegro.




I just tested out the most recent FBlend beta. Once you get Allegro working, you can get Fblend to work by:

Open up a command prompt via Start / Run / cmd.exe.

  1. SET PATH=C:\dev-cpp\bin;%PATH%
  2. SET MINGDIR=c:\dev-cpp
  3. cd\fblend
  4. fix mingw32
  5. make clean
  6. make
  7. make install


This will delete the default binaries and rebuild them to match your Allegro version.

Share this post


Link to post
Share on other sites

I went through steps 1-5 for Allegro, and it made loads of stuff then came up with "error 2", saying lots of things are undeclared. Instead, I've uninstalled it and started again, and just installed the DevPak.

I managed to compile fblend without error.

But now I feel kinda lost. I've put #include "fblend.h" in my header file, as in the example, and added this line of code, adapted from the same example:

fblend_trans(spritebitmap, screenbuffer, 0, 0, 100);

I've tried linking with

(blah blah blah)/Dev-Cpp/lib/libfblend.a

and

-lfblend

but when I compile my program I get these nasty looking errors:

[Linker error] undefined reference to 'masked_blit'
[Linker error] undefined reference to '_imp__cpu_capabilities'
[Linker error] undefined reference to '_imp__cpu_capabilities'
[Linker error] undefined reference to '_imp__cpu_capabilities'
Id returned 1 exit status
[Buld Error] etc

What could it all mean?

I'm totally lost, so if anyone has any ideas at all where the problem may be, eg it still can't find the libraries or maybe I need to add more code of some sort to my program, I'd be mega grateful. I've never used anyone else's libraries before, apart from the standard Allegro libraries.

Help me Obi-Wan. You're my only hope.

Share this post


Link to post
Share on other sites
There may be something wrong with one of the libraries you're using. At first glance it would appear to be Allegro, but who knows.

You said that you had some sort of "Error 2" when trying to compile Allegro, so you switched back to "the DevPak". I've never worked with a DevPak before, so I have no idea if something might be going wrong there. In any case, the errors you get when you try to compile your program show that, although the functions and globals were declared (i.e. allegro.h was included somewhere), the linker couldn't find them in any of the object code you gave it (your compiled source and any library files you use). Those particular items are from Allegro, so make sure you are indeed linking with -lalleg (or -lalld).

Just a quick summary of compiler errors, for when you're working with someone else's library:
- When you get an error during the compile stage ("Compiler Error" or unlabeled), it means that you haven't included the right header, or that the header needs a special option set to work properly. If you're sure you're including the right header, read the documentation. Three times.
- When you get an error during the linking stage ("Linker Error"), it means that you haven't included the right libraries. Or that something is missing from the library. (Not likely.)

Share this post


Link to post
Share on other sites

It's actually fine if I leave this in:

#include "fblend.h"

and comment out this line:

fblend_trans(spritebitmap, screenbuffer, 0, 0, 100);

So, it's only with that last line that I get those errors. Doesn't that mean it's Fblend?

The screenbuffer and sprites work as I can do this:

draw_sprite(screenbuffer, spritebitmap, 0, 0);


Share this post


Link to post
Share on other sites
If you put that line in, you get those linker errors? Ewww... no idea how that would be happening...

Share this post


Link to post
Share on other sites
Edward is correct in that linking order matters with MinGW.

Quote:
I went through steps 1-5 for Allegro, and it made loads of stuff then came up with "error 2", saying lots of things are undeclared.

Those errors do actually mean something...

Perhaps you don't have the Direct X SDK installed? You can get a mini version of it here: dx80_mgw.zip. I wouldn't worry about installing that unless you know those are the errors you were getting and you still plan on building Allegro.

For future reference, all common problems are listed in the FAQ.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!