Jump to content
  • Advertisement
Sign in to follow this  
szecs

Visual Studio 2008 [solved and not worth reading]

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

If you intended to correct an error in the post then please contact us.

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 this post


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

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by szecs
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).


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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 illegal
1> 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 this post


Link to post
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.

Thanks for your efforts guys!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!