473,383 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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:

Expand|Select|Wrap|Line Numbers
  1. // This is a commentThis_is_a_line;

is treated as:


Expand|Select|Wrap|Line Numbers
  1. // This is a comment This_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 מיכאל האפרתי
Oct 19 '14 #1
1 2739
weaknessforcats
9,208 Expert Mod 8TB
The first error is the important one:

Expand|Select|Wrap|Line Numbers
  1. main.cpp(325): error C2601: 'FLAG' : local function definitions are illegal
  2.  
You have defined function inside main.

At line 325 in your main.cpp the compiler knew it was in trouble when it reached the symbol FLAG.

The actual error is on that line or any line earlier in the file. Or in any includes prior to line 325.
Oct 19 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: DanTheMan | last post by:
Hi! I would like to make my own ide with Visual Studio. Are there any libraries that can help me out on the way? Something similar to Eclipse framework, that can speed this up? In Eclipse there...
0
by: Alan S | last post by:
I am getting an error taht says Visual Studio.Net has detected that the specified webserver is not running ASP.Net 1.1. However, I have made sure that everything is setup and I even found a technet...
0
by: Eric W. Holzapfel | last post by:
Hello Newgroup, I am trying (to no avail so far) to use and display one of the sample crystal reports that is incorporated with Visual Studio .net 2003 (World Sales Report.rpt) - just to get...
3
by: marmaxx | last post by:
I am currently making the transition from Visual Studio .NET 2003 to Visual Studio 2005, and I am looking for suggestions regarding how to implement an exception logging scheme. In my previous...
2
by: acteon | last post by:
Hello, I recently updated a web service project that was originally created by a consultant with Visual Studio 2003 with Visual Studio 2005. The .MSI file told me I needed the 2.0 framework,...
0
by: bernhard.nowara | last post by:
Hello, I found a bug in Visual Basic used with Visual Studio Macros (Microsoft Visual Studio 2005 + SP1). Description: If I apply the simple Visual Basic statement...
6
by: alf | last post by:
Hi, I want to add some library but it can not be comipled? Here is an output: D:\>cl Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86 Copyright (C) Microsoft...
4
by: Daniel | last post by:
How to take an IE rendered screenshot of a website with visual studio .net 2002 or visual stuido .net 2003? I can't install visual studio .net 2005 on this computer.
1
by: DR | last post by:
What ports do i need to unblock on client and server (running msvsmon.exe) to debug remotely from my client box with visual studio 2005 pro? When I attach to remote process a connection shows up...
3
by: fal11 | last post by:
this is my C# code System.IO.Directory.SetCurrentDirectory("C:/Users/fahime/Documents/Visual Studio 2010/WebSites/MyWebSite/UserFiles/ProblemAnswers/"); Process.Start("cmd.exe", @"/k ""C:\Program...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.