Unknown error compiling .. plz help!

This is a discussion on Unknown error compiling .. plz help! within the C Programming forums, part of the General Programming Boards category; Hi guys, I'm making a game in C where a dice rolls graphically (WinBGIm). and has a game logic that ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    53

    Unknown error compiling .. plz help!

    Hi guys, I'm making a game in C where a dice rolls graphically (WinBGIm). and has a game logic that I have wrote, However when i compile the project it comes up with an error saying "A function definition is not allowed here before '{' token, but everything looks as it should.

    I have written a smaller program just to post so its not cheating but the small program compiles fine so it would be useful so instead I'm attatching the whole .c program.

    if someone could please create a project and add this code on there system and then show me what I have done wrong that would be much appriciated.

    Thanks in advance.

    ps I havnt included the jpeg's because the maximum I can upload is five but that shouldnt change anything.
    Attached Files Attached Files

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Hint: Line 184-222 of StopDice.c

    Count the opening braces and closing braces

  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,543
    I think you need to indent a little more consistently.
    If you add another tab or some spaces after each {, you should have no problem locating places where you need to put a }.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    A development process
    Small steps, compile often, test as you go.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can any1 plz make this assignment
    By jean in forum C Programming
    Replies: 17
    Last Post: 05-13-2009, 09:19 PM
  2. [Request] Need Help Plz
    By TylerD in forum Tech Board
    Replies: 4
    Last Post: 01-03-2009, 08:54 AM
  3. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM

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