Thread: Allegro installation help

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    48

    Allegro installation help

    I am trying to install allegro to use the game development libraries but I am struggling. I cannot register at allegro because of some CAPTCHA words that I do not see and the codeblocks forum aggrevated me just trying to post, all searches I try are 3-4 years old.

    Basically I have ..codeblocks-10.05mingw-setup.exe, which I assume has all the latest mingw compiling stuff I need, I'm pretty sure I have the latest directX stuff but I haven't even got that far yet.

    I have the latest source and binary packages for allegro... allegro-4.4.0.1.zip and allegro-5.0.0-rc4-mingw-3.4.5.zip. I do not understand the binary package I figured it would have some kind of installation executable or something, do I have to just tell codeblocks where to look for the libraries?

    With the source I extracted it to C:\program files\codeblocks\mingw\allegro (probably not the best place).

    I tried to follow step by step instructions using the command prompt but everything I tried to type said it was unrecognizable and so I can't do anything with it.

    What do I do?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    What are you trying to type at the prompt? If it's things like "gcc" you'll have to set the paths appropriately. If it's Linux bash commands, you'll have to do the cmd shell equivalent.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    I can't find the search result now but the first was "fix mingw" and fix was not recognized, but anyway please explain something...

    Using this link...

    Code::Blocks - Allegro Wiki

    The first step is to download mingw, the images are nothing like the newest version but is this all not included in the codeblocks-10.05mingw-setup.exe?

    Can I skip this step? I uninstalled codeblocks to do it this way but I don't know what to choose in the latest mingw installation so can I just install codeblocks again and go from there?

    I tried the FIX.BAT mingw in that link previously but nothing, man this is real confusing.

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    OK so I followed the instructions on that link except being under the assumption that the minGW stuff is included in codeblocks, everything appeared to work fine until I tried a program which is an example from a tutorial...

    Code:
    #include <allegro.h>
    
    
    int main(){
     
        allegro_init();
        install_keyboard();
        set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
        
        readkey();
        
        return 0;
        
    }   
    END_OF_MAIN();
    Heres a quote from the end of this link..
    Once you've done that, right click the project icon and select Build options. On the window that appears click on the Linker settings tab. Click the Add button. Navigate to the Allegro Library file, which should be C:\allegro\lib\mingw32\liballeg.a and press OK.
    Project Icon? I went to the compiler settings and then the linker settings and tried to add as it said but there was no liballeg.a in that directory so all I get is..

    "test - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
    Nothing to be done.
    EDIT ----- Just noticed this error message in the console...

    src/i386/icpus.s:70: Error: suffix or operands invalid for 'fnstsw'
    MINGW32-MAKE.EXE: *** [obj/mingw32/alld/icpus.o] Error 1
    Last edited by MattJ812; 02-01-2011 at 10:14 PM. Reason: Just noticed an error message

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    If you downloaded CodeBlocks-with-MinGW, then you already have MinGW. I believe you also have the mingw32-make as well. You should check, though, once you've put C::B back to make sure you have that there. So yes you should skip that step if you already have it installed.

    I don't know what's in FIX.BAT since I haven't tried to download the package. Downloading DirectX 7.0 is ..., well, it's okay, I guess, but again they've moved on. I don't know whether Allegro requires that exact version or not.

  6. #6
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by MattJ812 View Post

    Project Icon? I went to the compiler settings and then the linker settings and tried to add as it said but there was no liballeg.a in that directory so all I get is..
    When you did the MINGW32-MAKE thing at the end, that should have created a liballeg.a file. You may want to look around to see where it ended up; it really ought to go in C:\MinGW\lib. (You might have other things between the C: and the MinGW.)

    Quote Originally Posted by MattJ812 View Post
    EDIT ----- Just noticed this error message in the console...

    src/i386/icpus.s:70: Error: suffix or operands invalid for 'fnstsw'
    MINGW32-MAKE.EXE: *** [obj/mingw32/alld/icpus.o] Error 1
    .s is assembler. This is starting the ominous organ music, IMO.

  7. #7
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    I thought direct x was up to 9 or so, but as for that download I thought it was specific compiler settings, but either way I do not have liballeg.a and cannot find it in a search. Ill try some other downloads and see what comes up.

    EDIT--- Man I am tired of old how to's the new version doesn't even have a lib directory, this is ridiculous.
    Last edited by MattJ812; 02-01-2011 at 10:27 PM.

  8. #8
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by MattJ812 View Post
    I thought direct x was up to 9 or so, but as for that download I thought it was specific compiler settings, but either way I do not have liballeg.a and cannot find it in a search. Ill try some other downloads and see what comes up.
    When you did the MAKE step on the allegro download -- you should have seen things (granted a lot of things) on the screen about files being created. Or, in this case perhaps, some errors about them not being created. So revisit that step.

  9. #9
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    heh now codeblocks doesn't do anything at all, and the liballeg.a file (created then or not) was in c:\dev-cpp. I can only assume that folder was created when I was trying different compilers and somehow its still there. Gonna delete everything and start again blaming microsoft.

    Err IDE's not compilers

  10. #10
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    OK i started again installed codeblocks to c:\codeblocks. mingw is now c:\codeblocks\mingw.

    I downloaded the prebuilt allegro library for MinGW (gcc 3.3) from here... Files

    I extracted all files to c:\allegro and then copied the contents of allegro/bin to mingw/bin, allegro/lib to mingw/lib and allegro/bin to mingw/bin.

    I used this sample to test it...

    Code:
    #include <allegro.h>
    
    int main(){
    
        allegro_init();
        install_keyboard();
        set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
    
        readkey();
    
        return 0;
    
    }
    END_OF_MAIN();
    And got these errors when I tried to build and run...

    Code:
    ||=== test, Debug ===|
    obj\Debug\main.o||In function `Z13_mangled_mainv':|
    C:\C++_Projects\test\main.cpp|7|undefined reference to `_install_allegro_version_check'|
    C:\C++_Projects\test\main.cpp|8|undefined reference to `install_keyboard'|
    C:\C++_Projects\test\main.cpp|9|undefined reference to `set_gfx_mode'|
    C:\C++_Projects\test\main.cpp|11|undefined reference to `readkey'|
    obj\Debug\main.o||In function `WinMain@16':|
    C:\C++_Projects\test\main.cpp|16|undefined reference to `_WinMain'|
    ||=== Build finished: 5 errors, 0 warnings ===|
    Then I thought I may have to add a link in my linker settings so I added c:\codeblocks\mingw\lib\liballeg.a in my linker settings and now I get this pop up message instead...

    The proecdure entry point _install_allegro_version_check could not be located in the dynamic link library alleg42.dll

  11. #11
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Ooh. Do you have alleg42.dll? Otherwise, there might perhaps be some name-mangling (not) going on. Someone check me on this, because this is off the top of my head: the underscore at the beginning refers to a C-style decoration (i.e., cdecl). (Compare that one having an underscore with the rest not having an underscore.) You downloaded the pre-built dlls? I would expect those to have the right mangling.

    I've never tried to install Allegro myself, so I can't say from experience what's the best approach here.

  12. #12
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    I finally got on the forum at allegro, IE was stopping "unsafe" content.

    Anyhow it appears to be working now, I was supposed to put the dlls from allegro\bin into the folder that my executable was in or in system32.

    I tried to put them in system32 and there was already a alleg42.dll in there. I assume, but I'm not sure, that it was created during my original compiling attempt and wasn't right, or was the wrong version because it was a different size.

    I dunno but I made a copy of the existing dll and put the new one in its place and it appears to work.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. installing and setting up Allegro
    By Emotions in forum Game Programming
    Replies: 11
    Last Post: 12-30-2004, 06:28 PM
  2. Game Programming FAQ
    By TechWins in forum Game Programming
    Replies: 5
    Last Post: 09-29-2004, 02:00 AM
  3. allegro installation problems on dev-c++
    By ichijoji in forum Game Programming
    Replies: 5
    Last Post: 09-14-2004, 10:57 AM
  4. double buffering for allegro
    By Leeman_s in forum C++ Programming
    Replies: 6
    Last Post: 09-12-2002, 02:45 PM
  5. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-20-2002, 11:35 PM