1

My version of DEV C++ is 5.11 and I have used version SDL2-2.0.12 and OS is Windows 10. Folder path of sdl.h file is C:\Program Files (x86)\Dev-Cpp\SDL2-2.0.12\x86_64-w64-mingw32\include\SDL2

I have done my project settings as shown in :: https://thenumbat.github.io/cpp-course/sdl2/01/devSetup.html#:~:text=Open%20up%20your%20project%20and,and%20select%20the%20lib%20folder.

My program

#include <iostream>
#include "SDL.h"

using namespace std;

int main( int argc, char* args[] )
{
  
        if(SDL_Init(SDL_INIT_EVERYTHING) < 0) 
        {
            cout << "SDL init failed.\n";
            return 1;
        }       
        
        SDL_Quit();    
        return 0;    
}

While compiling I am getting such message::

C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingw32.a(lib64_libmingw32_a-crt0_c.o) In function `main':

C:\crossdev\src\mingw-w64-v3-git\mingw-w64-crt\crt\crt0_c.c undefined reference to `WinMain'

------ this is in red color ---------
C:\Program Files (x86)\Dev-Cpp\SDL2-2.0.12\x86_64-w64-mingw32\collect2.exe  [Error] ld returned 1 exit status

C:\Program Files (x86)\Dev-Cpp\SDL2-2.0.12\x86_64-w64-mingw32\Makefile.win  recipe for target 'SDLproj1.exe' failed

Please see the attached image.

enter image description here

Botje
  • 21,384
  • 3
  • 27
  • 38
nischalinn
  • 1,053
  • 2
  • 10
  • 33

0 Answers0