getting to grips with allegro and ms vc++ (newbie)

This is a discussion on getting to grips with allegro and ms vc++ (newbie) within the C++ Programming forums, part of the General Programming Boards category; ok well it seems that i post here once every month or so as a complete newbie coz i just ...

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    11

    getting to grips with allegro and ms vc++ (newbie)

    ok well it seems that i post here once every month or so as a complete newbie coz i just got interested in c++ again, again, so here goes.

    found out about the allegro library and it seems to be pretty cool, and i also have just aquired ms visual studio 6 and i am trying to get my first thing compiled but i cant seem to get it to work

    i made a new empty win32 c++ application

    i added a source file called main.cpp

    Code:
    #include <allegro.h>
    
    int main (int argc, char *argv[])
        {
        allegro_init();
        install_keyboard();
        set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
        readkey();
        return 0;
    }
    
    END_OF_MAIN();
    i tried to compile it by going build>buildallegrotest.exe and also the other options i think i tried them all and it just said i had an "error" in the output box. so i added allegro.h to it. but it made no difference.

    how do you go about compiling something like that? i am a TOTAL newbie so please be nice to me

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,074
    Is allegro.h in your compiler's include directory with the rest of your standard libraries?

    If it isn't then put it into the same directory as the your .cpp and change your include to
    Code:
    #include "allegro.h"
    Also, may I ask what END_OF_MAIN() is supposed to be?
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Go to project->settings and click on the link tab. Then add allegro.lib (I think thats it's name) to the list of objects.

  4. #4
    Registered User
    Join Date
    Jul 2005
    Posts
    11
    END_OF_MAIN is an allegro function that you have to call after the end of the main (surprisingly) at least according to a tutorial im following. thanks for the tips, ill post with the results

    edit

    --------------------Configuration: allegrotest - Win32 Debug--------------------
    Compiling...
    main.cpp
    c:\program files\microsoft visual studio\vc98\include\allegro\platform\aldjgpp.h(20) : fatal error C1083: Cannot open include file: 'pc.h': No such file or directory
    Error executing cl.exe.

    allegrotest.exe - 1 error(s), 0 warning(s)
    i got no idea what "pc.h" is, and it didnt come with the allegro source. did i accidentally mess up something? is ph.h a standard header file that should be there?

    *is confused*
    Last edited by jimjamjahaa; 11-18-2005 at 04:37 PM.

  5. #5
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,074
    Is it being included in aldjgpp.h?

    ... well perhaps that's obvious.

    Check the internet perhaps, maybe you can find a copy of it.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21