# expected primary expression before "extern"

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

## Recommended Posts

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.

##### Share on other sites
you should probably post the problem area of the code so people can look at it

moe.ron

##### Share on other sites
        //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.

##### Share on other sites
where is END_OF_MAIN() located and what prototype does it have ? or is it perhaps a macro ?

##### Share on other sites
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?

##### Share on other sites
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.

##### Share on other sites
Try it without the ;

Just END_OF_MAIN()

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634107
• Total Posts
3015549
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!