Thread: Unknown error compiling .. plz help!

  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.

  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をこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    http://cboard.cprogramming.com/showthread.php?t=88495
    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.

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, 09: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