Thread: Build Errors

  1. #1
    Registered User
    Join Date
    Jul 2007

    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


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

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Jul 2007

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    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.

  6. #6
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    New Zealand
    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, 11:37 AM
  4. executing errors
    By s0ul2squeeze in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2002, 01:43 PM