Issue with the C2447 error message

Hey, this is a definite noob question here, but I am absolutely stumped. Here's what's happening:

I'm trying to modifying an existing open-source game in C++, and I'm trying to compile a particular application. Problem is, I keep getting the following error message:

k:\old esms source code\league_table.cpp(8) : error C2447: '{' : missing function header (old-style formal list?)

First off, I'll admit that I know next to nothing about C++- I'm basically feeling my way around in the dark, as it were. However, I understand that this particular error message typically means that there is a misplaced semi-colon. This particular example, though, is right at the very beginning of the code, and I can't see any sign of such a semi-colon (maybe I'm missing it).

The program was originally written in C and converted to C++, so perhaps the issue is there.

Here are the relevant lines of code (the full code is 250+ lines long). Any help that could be offered would be appreciated.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// ESMS - Electronic Soccer Management Simulator
// Copyright (C) <1998-2005>  Eli Bendersky
//
// This program is free software, licensed with the GPL (www.fsf.org)
// 
#include "league_table.h"

{ bool team_data_predicate(league_table::team_data data1 , league_table::team_data data2)
{
    if (data1.points != data2.points)
        return data1.points > data2.points;
    else
    {
        if (data1.goal_difference != data2.goal_difference)
            return data1.goal_difference > data2.goal_difference;
        else
            return data1.goals_for > data2.goals_for;
    }
}



{ bool team_
That brace doesn't belong there.
Last edited on
Hi.I am a newhand too.However I think there definitely exists an unnecessary '}' in line 8.
Hope this helps.
I suspect that the brace is for the end of the program, 250+ lines down (I think).

When I remove it and try to re-compile, I get the following error messages:

k:\old esms source code\league_table.cpp(252) : error C2059: syntax error : '}'
k:\old esms source code\league_table.cpp(252) : error C2143: syntax error : missing ';' before '}'
k:\old esms source code\league_table.cpp(252) : error C2059: syntax error : '}'


Anything else up at the top of the program that might do it?
Line 252, by the way, is just a bracket

 
}


I've tried to trace it, but best as I can tell, it's connected to that bracket in front of the boolean at the beginning.
Upon removing the bracket at the end, I receive something like 16 error messages, all talking about unresolved external symbols
Sigh... Nobody listens.
?

My apologies if I missed something.

Does the brace not belong in the code at all, or should it be moved elsewhere?
It shouldn't exist at all.
Well, I did remove it, but then the aforementioned code problems popped up.

Those I have no clue how to fix whatsoever.

Sorry- I know that I'm a noob at this- Just can't seem to figure this one out.
Just to clarify: I don't think I made this clear

When I removed the brace from the code entirely, I got this:

k:\old esms source code\league_table.cpp(252) : error C2059: syntax error : '}'
k:\old esms source code\league_table.cpp(252) : error C2143: syntax error : missing ';' before '}'
k:\old esms source code\league_table.cpp(252) : error C2059: syntax error : '}'

Down at the end of the code.
Oh, sorry, I misunderstood what you said.

If there's any syntax error, it's coming from elsewhere in your code. Without that brace, the fragment you posted is valid.
Hmm. I'm afraid I'm in for a rough time, in that case, but I probably should be, because I'm not 100% sure how this program even works the way it does anyway.
Topic archived. No new replies allowed.