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

1. ## 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. 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?

3. 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. 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*

5. Is it being included in aldjgpp.h?

... well perhaps that's obvious.

Check the internet perhaps, maybe you can find a copy of it.

Popular pages Recent additions