   Error C2447: '' : missing function header (old-style formal list?) - What gives?
  Here's my source that gives this error:#include <SDL.h> //This is Line 1. Top of the program!! So, constants go here.const int LEVEL_WIDTH = 300;const int LEVEL_HEIGHT = 160;const int SCREEN_WIDTH = 240;const int SCREEN_HEIGHT = 160;const int SCREEN_BPP = 32; //Bit per pixel.class Camera{private:SDL_Rect View;public:Camera();void set_camera(int X_Coordinate, int Y_Coordinate, int Width, int Height);SDL_Rect get_camera();};Camera::Camera(){ //<-- Compiler gives Error C2447 here.View.x = 0;View.y = 0;View.w = SCREEN_WIDTH;View.h = SCREEN_HEIGHT;}void Camera::set_camera(int X_Coordinate, int Y_Coordinate, int Width, int Height){View.x = X_Coordinate;View.y = Y_Coordinate;View.w = Width;View.h = Height;}SDL_Rect Camera::get_camera(){return View;}It appears on line 20, where my Camera constructor resides.It said something about my bracket, and complains about it being old-style...Other than that, I have no idea what is wrong. Other classes I've created not too long ago, didn't have this error.So, either I'm missing something, or there's practically something that's bogging my VS 2010 compiler. (I also think that VS 2008 compilers and VS 2010 compilers have different changes.)If anyone can find out what makes the compiler complain, I'll be happy for the rest of the week. :) Thanks in advance.   
  I can't find anything wrong with the code you posted.  Is this your entire source, or is this a header file?  You could try searching for errors in the sources that include this file.  Is this the exact code you're trying to compile (i.e., is there any possibility that you copied your source wrong)?   ;  Here's my error list. All of them came from "camera.h". All of the "main.cpp" errors came from "camera.h" also.   ;  Usually when you get that error it's because of a misplaced semicolon, but I don't see one in the above. Did you cut-and-paste your actual code?Edit: oh didn't see your second post. C2447 isn't the first error so never mind.I mean from what you've shown it has to be some issue with the include. Don't know anything about SDL, but if you comment out the declaration and definition of Camera and compile just the include, does it complain?   ;  looks like you might need include guards? for MSVC++ try adding #pragma once to the top of your header (I recommend using a more portable #ifdef scheme of include guards though)   ;  After using either #ifdef and #ifndef, or #pragma once, there appears to be more errors.Mostly in my "main.obj"...   ;  I'm guessing they're linker errors, not compiler errors.This would be because you're writing function implementations (e.g. Camera::Camera(), Camera::set_camera, etc) in a header. This means they'll be compiled for every CPP file that includes that header. When the linker tries to link all the compiled CPP files (i.e. the OBJ files) together, it's got multiple copies of Camera::set_camera and can't decide which one to use.[edit]You'll probably also be getting errors for your global variables (e.g. LEVEL_WIDTH, etc). There's 2 ways to fix theseOption #1In the header:extern const int LEVEL_WIDTH;In ONE CPP file:const int LEVEL_WIDTH = 300;Option #2:In the headerstatic const int LEVEL_WIDTH = 300;Option #1 puts the variable into one OBJ file only, but uses the extern keyword to let other files link to it. Option #2 duplicates the same variable in every OBJ file, but let's the linker know to ignore the conflicts.   ;  For the SCREEN_WIDTH , SCREEN_BBP, and SCREEN_HEIGHT, static won't do.And, the first option didn't work. It leads me to much complicated errors related to object files.[Edited by - tom_mai78101 on May 12, 2010 9:47:57 AM];  Are you trying to compile this as C instead of C++? Check the compiler settings. If this file is part of SDL project or solution, this is very likely.   ;Quote:Original post by AntheusAre you trying to compile this as C instead of C++? Check the compiler settings. If this file is part of SDL project or solution, this is very likely.I'm very curious on how you do that?   