I followed many tutorials but none of them worked
PS D:test> cd "d:test" ; if ($?) { g++ tempCodeRunnerFile.cpp -o tempCodeRunnerFile } ; if ($?) { .tempCodeRunnerFile }
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
PS D:test> cd "d:test" ; if ($?) { g++ test.cpp -o test } ; if ($?) { .test }
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x502): undefined reference to `SDL_SetRenderDrawColor'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x55c): undefined reference to `SDL_RenderFillRect'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x59a): undefined reference to `SDL_Init'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x5ce): undefined reference to `SDL_CreateWindow'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x5ec): undefined reference to `SDL_CreateRenderer'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x631): undefined reference to `SDL_PollEvent'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x671): undefined reference to `SDL_SetRenderDrawColor'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x67c): undefined reference to `SDL_RenderClear'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x69a): undefined reference to `SDL_RenderPresent'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x6b0): undefined reference to `SDL_Delay'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x6c5): undefined reference to `SDL_DestroyRenderer'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x6d0): undefined reference to `SDL_DestroyWindow'
C:UsersNANI.SAppDataLocalTempccBqTWiy.o:test.cpp:(.text+0x6d5): undefined reference to `SDL_Quit'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
I’ve changed the include path but nothing changed
#include”src/include/SDL2/SDL.h”
I am using latest version of MinGW and SDL.
I have added SDL2.dll to the project directory.
New contributor
Sadhanala Hanumantha Rao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.