Build Errors

This is a discussion on Build Errors within the C++ Programming forums, part of the General Programming Boards category; Does anyone know why i am getting this error c:\documents and settings\hp_administrator\my documents\visual studio 2005\projects\beta1\beta1\mainfile.cpp(60) : fatal error C1075: end ...

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    75

    Exclamation Build Errors

    Does anyone know why i am getting this error

    c:\documents and settings\hp_administrator\my documents\visual studio 2005\projects\beta1\beta1\mainfile.cpp(60) : fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\hp_administrator\my documents\visual studio 2005\projects\beta1\beta1\mainfile.cpp(17)' was matched

    thanks

  2. #2
    l2u
    l2u is offline
    Registered User
    Join Date
    May 2006
    Posts
    630
    Cant you read?
    numbers of left and right braces dont match.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,310
    Basically, it could not find the closing brace to an opening brace. A possible reason is that you forgot to close your main() function's opening brace. Indenting your code properly will help prevent this kind of problem in the future.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    thanks

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    Always type them in in pairs (ditto for (), "" and /**/), then move the cursor to insert the content you want.

    It's a couple of extra key presses, but at least you'll never be in the situation of playing find the matching position and insert.

    Plus it makes your code more amenable to incremental compilation to check that what you're writing will at least compile.
    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.

  6. #6
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,288
    Also be careful when putting a #ifdef BLAH around a block of code. The #endif has to be in the right place, with respect to the number of curly brackets
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  2. Header File Errors...
    By Junior89 in forum C++ Programming
    Replies: 5
    Last Post: 07-08-2007, 12:28 AM
  3. Visual C++
    By gvector1 in forum Windows Programming
    Replies: 20
    Last Post: 03-14-2003, 10:37 AM
  4. executing errors
    By s0ul2squeeze in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2002, 12:43 PM

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