Public Group

# Visual Studio 2008 [solved and not worth reading]

This topic is 3300 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

error C2601: local function definitions are illegal All my headers' functions have that I didn't have this with VC++6.0. Thanks in advance! [Edited by - szecs on October 31, 2009 2:34:14 PM]

##### Share on other sites
The error message pretty much means what it says on the tin.. could you post one of these headers?

##### Share on other sites
It usually happens when you forget a closing brace, '}'

But yeah, you'll have to post some code for us to really know what's going on...

##### Share on other sites
I found that solution on other forums, BUT:
I loaded exactly the same project with 2008 that worked perfectly with VC++6.0.
No change at all. (I didn't do anything with the files).
BTW is there way to find that possible '}'? The code is at least 10000 lines of code. (It's the demo in my signature)

##### Share on other sites
Quote:
 Original post by szecsI found that solution on other forums, BUT:I loaded exactly the same project with 2008 that worked perfectly with VC++6.0.No change at all. (I didn't do anything with the files).

VC 2008 (indeed anything past VC 6) is stricter on standards (this is a good thing), so you needn't have changed a file for this to start happening.

Quote:
 BTW is there way to find that possible '}'? The code is at least 10000 lines of code. (It's the demo in my signature)

Look at where the error is occuring, and work upwards.

##### Share on other sites
83 errors so far, probably all of my functions, defined in headers.
I commented out the headers one by one.
Is there a feature in VS 2008 to find the matching '{' '}' ?

Do I have to declare all of them at the beginning of the main file in VS 2008?
Meaning:
void Function();
....
all stuff..
..
void Function()
{...
}
(I don't even know the proper terms)
I know it's the way to do it, but I was lazy, and it worked so far...

##### Share on other sites
They're called function prototypes, and you would be getting a different error message if that was the case.

You can match a given brace by putting your caret beside it, and pressing CTRL+}.

You could also try pressing CTRL+M, CTRL+L to toggle all folds.. you might be able to better see how the functions are being parsed then.

##### Share on other sites
Take the first error, and post the exact error message and the code around where the error occurs so we can see. We're just guessing if you don't post code :)

##### Share on other sites
Just as an aside, I just tried missing a '}' and got:

1>blah.cpp(17) : error C2601: 'fn' : local function definitions are illegal1>        blah.cpp(9): this line contains a '{' which has not yet been matched

So before you go off on a wild goose chase for a missing }, consider the fact that you're not getting that extra line (I hope..) and that you haven't changed any files. It's more likely to be something else instead.

##### Share on other sites
Yes I got that message, but there wasn't any '{' there. I re-saved the file that it worked.

Now I get 777 warnings.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633270
• Total Posts
3011158
• ### Who's Online (See full list)

There are no registered users currently online

×