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

WEBINAR: On-demand webcast

How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >

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


Comments

  • 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 software-defined data center (SDDC) and new trends in cloud and virtualization bring increased agility, automation, and intelligent services and management to all areas of the data center. Businesses can now more easily manage the entire lifecycle of their applications and services via the SDDC. This Aberdeen analyst report examines how a strong foundation in both the cloud and internal data centers is empowering organizations to fully leverage their IT infrastructure and is also preparing them to be able …

  • Event Date: Tues, December 5, 2017 at 1:00 p.m. ET/10:00 a.m. PT Modernizing the enterprise data center to address raging demands for speed, performance, and capacity is a top directive for many IT organizations. While it's a known fact that upgrading to next-generation flash and solid-state drives (SSDs) can improve IT agility and application performance, the lower cost of legacy hard-disk drives (HDDs) has confined SSD use to only 10% of the data center. But that's changing. Don't guesstimate the …

Most Popular Programming Stories

More for Developers

RSS Feeds

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