I am working on using c++ to make a 2d action game and I am using dev-c++. When I include this header I get the error
[Linker error] undefined reference to `WinMain@16'.
This is the header code.
//Allows a header file to be a header file
#ifndef _SDL_GOVvsHR_H_
#define _SDL_GOVvsHR_H_
//Basic libraries
#include <iostream>
#include <string>
#include <SDL.h>
usingnamespace std;
//blank function
void SDL_GOVvsHR() {
cout << "Welcome to Goverment vs Heavy Rock.";
cin.get();
return;
}
//Ends the special header file stuff
#endif
#undef _SDL_GOVvsHR_H_
Well, you should tell us what line your getting that error. First, I believe SDL.h is from a tutorial, you need to put that in the same folder as your project files and it should be:
#include "SDL.h"
Because it is not in the standard library and is a header your including.
Your function on line 12, it returns void, no need for line 15