I know this has probably been asked/answered a thousand times across the internet but I can't seem to find any of the answers that will finally find where I'm going wrong.
I'm currently following a course on Udemy on "C++ For Complete Beginners" and I've reached almost the very end of the course where we start to use SDL for a small project.
When I follow the exact steps that the tutor provides I get an error.
The error in question looks like this:
C:/Users/Ghost/gcc/x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text+0x3d): undefined reference to `WinMain'
And the code to go alongside it is:
#include <iostream>
#include <SDL.h>
using namespace std;
int main() {
if(SDL_Init(SDL_INIT_VIDEO) < 0 ) {
cout << "SDL Init Failed" << endl;
return 1;
}
cout << "SDL Init Succeeded" << endl;
SDL_Quit();
return 0;
}
All that the program needs to do is either output one of the cout statements. Nothing more, Nothing less.
I have installed SDL2, mingw and eclipse. Eclipse has worked with everything up until this point but when I followed the steps by the tutor it no longer wants to work.
The header files and the library has been connected to the program as well.