A strange problem with Visual Studio (error C1075 and C2601)

Using Visual Studio 2013 C++, I got compilation errors that I couldn't explain.  
The compilation errors were:  

[*]*main.cpp(325): error C2601: 'FLAG' : local function definitions are illegal   [*]main.cpp(323): this line contains a '{' which has not yet been matched   [*]main.cpp(326): fatal error C1075: end of file found before the left brace '{' at 'main.cpp(323)' was matched*

  But there was nothing wrong with my code. I counted all brackets and the number matched. There weren't any function inside another function.


I solved it by removing all "//" comments from the source code. It seems that the reason for that is bad line formatting which causes the compiler to miss a line break, so the line after a comment is treated as a comment as well.

  For example:

// This is a commentThis_is_a_line;

  is treated as:  

// This is a commentThis_is_a_line;


There are many posts of the net about similar problems and some even suggested that they could be caused by a memory (RAM) fault on the machine, so before you replace your RAM, just remove the comments and see...

--- Michael Haephrati


  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • The open source cloud computing project OpenStack has come a long way since NASA and Rackspace launched it in 2010. Backed by leading technology infrastructure providers including Cisco, Dell, EMC, HP, IBM, Intel, and VMware, OpenStack underpins significant workloads at an increasingly diverse set of organizations, including BWM, CERN, Comcast, eBay, and Wal-Mart. For CIOs engaged in broader programs to win, serve, and retain customers -- and refocus business technology (BT) spend -- a planned and pragmatic …

  • Featuring Mary Wardley, VP, Enterprise Applications and CRM Software, IDC Live Event Date: Wednesday, November 16, 2016 10 AM PT / 1 PM ET Significant changes are coming to the contact center, with new technologies enabling better customer engagement, innovative journey analytics and streamlined proactive communications. But the future holds some amazing advances which will change the role of the contact center in tomorrow's organizations. This is a critical time to understand what's coming and how an agile …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date