Jump to content
  • Advertisement
Sign in to follow this  
jaytee81

expected primary expression before "extern"

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
        //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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!