Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,206 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,382 people online right now. Registration is fast and FREE... Join Now!




Compile errors

 
Reply to this topicStart new topic

Compile errors, error C2447: '{' : missing function header (old-style formal l

hellfury
9 Jul, 2008 - 05:17 AM
Post #1

New D.I.C Head
*

Joined: 4 Jul, 2008
Posts: 3

Here is the error i am getting:

CODE
2>c:\arcemu\svn\trunk\src\ascent-world\Player.h(695) : error C2447: '{' : missing function header (old-style formal list?)


And here are the lines that the error occured on:

CODE
#define OPTIMIZED_PLAYER_SAVING()

{
    friend class WorldSession;
    friend class Pet;
    friend class SkillIterator;


Cheers,
Ben
User is offlineProfile CardPM
+Quote Post

gabehabe
RE: Compile Errors
9 Jul, 2008 - 05:25 AM
Post #2

Donkey DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 5,556



Thanked: 99 times
Dream Kudos: 2650
Expert In: ruling the world.

My Contributions
You need a name. Is this supposed to be a class? Try something like:
cpp
class CMyClass
{
friend class WorldSession;
friend class Pet;
friend class SkillIterator;
}; // don't forget the semi-colon at the end

Hope this helps smile.gif
User is offlineProfile CardPM
+Quote Post

Cerolobo
RE: Compile Errors
9 Jul, 2008 - 05:28 AM
Post #3

D.I.C Regular
Group Icon

Joined: 5 Apr, 2008
Posts: 440



Thanked: 31 times
My Contributions
That basically means you have a stray function body, class definition, or structure definition.

Since you have friend in there, I'm going to assume it's supposed to be a class.

CODE
#define OPTIMIZED_PLAYER_SAVING()
class foo // <- Expecting something like this
{
    friend class WorldSession;
    friend class Pet;
    friend class SkillIterator;

    // ...
};


Edit: Arg... You beat me by 3 minutes confused.gif

This post has been edited by Cerolobo: 9 Jul, 2008 - 05:32 AM
User is offlineProfile CardPM
+Quote Post

hellfury
RE: Compile Errors
9 Jul, 2008 - 05:33 AM
Post #4

New D.I.C Head
*

Joined: 4 Jul, 2008
Posts: 3

Thanks for the help,
But now i get 144 errors
User is offlineProfile CardPM
+Quote Post

gabehabe
RE: Compile Errors
9 Jul, 2008 - 05:35 AM
Post #5

Donkey DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 5,556



Thanked: 99 times
Dream Kudos: 2650
Expert In: ruling the world.

My Contributions
woooo I beat Cerolobo! tongue.gif

What are the 144 errors? I doubt they're all being caused by this problem... I should imagine that you have more errors later on, syntax errors and such...
User is offlineProfile CardPM
+Quote Post

Cerolobo
RE: Compile Errors
9 Jul, 2008 - 05:35 AM
Post #6

D.I.C Regular
Group Icon

Joined: 5 Apr, 2008
Posts: 440



Thanked: 31 times
My Contributions
We'll need to see a larger snippet of your code. IE, if that was a part of another class, post the full deceleration of the class. If you post the entire header (I assume that's where it came from), then please post with

[*code=cpp]
//code
[*/code]

but without the *

That'll add line numbers, which is really nice for tracking down errors.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 12:40PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month