expected primary expression before "extern"

Started by
5 comments, last by outRider 18 years, 10 months ago
Hi there, I am working through Jon Harbours Game Programming All In One Book. I have just spent the last hour or so going through the Tank War code at the end of the chapter to be hit with the error as stated in the subject of this thread upon compilation. I am using Dev-C++ along with the Allegro library. The error points right to the END_OF_MAIN(); part you have to put in after the closing brace of your main function. I have no clue what this error wants from me and was hoping someone may have come across a similar problem and know the solution. Thanks for any time you can spare.
Advertisement
you should probably post the problem area of the code so people can look at it

moe.ron
moe.ron
        //destroy bitmaps         destroy_bitmap(explode_bmp);         destroy_bitmap(back);         destroy_bitmap(scroll);         destroy_bitmap(buffer);         for(n = 0; n < 8; n++)         {               destroy_bitmap(tank_bmp[0][n]);               destroy_bitmap(tank_bmp[1][n]);         }                  allegro_exit();         return;}END_OF_MAIN();


That's basically the end of the code and the error points to the END_OF_MAIN() that allegro needs to finish up.
where is END_OF_MAIN() located and what prototype does it have ? or is it perhaps a macro ?
---novocaine thru yer veinz
I believe that END_OF_MAIN() is simply a built-in function of Allegro that acts as a sort of "wrapper" for the Windows API.

What is the specific error text that you are getting? I know that you said it points to the END_OF_MAIN(); function, but could you copy&paste the actual error message?
Depending on what compiler you are using, it is unfortunately possible that the error is nowhere near where the compiler thinks it is. In this case, I'd take a careful look around any "extern" statements I'd made, and double-check that all my headers were mentioned and getting included correctly.
-----http://alopex.liLet's Program: http://youtube.com/user/icefox192
Try it without the ;

Just END_OF_MAIN()

This topic is closed to new replies.

Advertisement