SDL2_mixer undefined reference error?

Hello, I am using the 64 mingw library for SDL2 mixer as well as the corresponding SDL2 and SDL2_images packages.

Whenever I try to compile my program it shows the undefined reference error, even though all files are correctly placed to whichever directory they need to be.

I have tried moving around the linker flag (-lSDL2_mixer), I have checked for typos, and literally everything that can be the source of such a problem and I still cannot come to realise what produces this error, I am in dire need of help here…

Specifically, it shows undefined references for these functions:

C:\Users\Peaky\AppData\Local\Temp\ccBVTStZ.o:main.cpp:(.text+0x71e): undefined reference to Mix_Quit' C:\Users\Peaky\AppData\Local\Temp\cc0hzdCA.o:init_win.cpp:(.text+0x3e): undefined reference to Mix_Init’
C:\Users\Peaky\AppData\Local\Temp\cc0hzdCA.o:init_win.cpp:(.text+0x62): undefined reference to Mix_OpenAudio' C:\Users\Peaky\AppData\Local\Temp\ccNacBJ2.o:sound.cpp:(.text+0x5a): undefined reference to Mix_LoadWAV’
C:\Users\Peaky\AppData\Local\Temp\ccNacBJ2.o:sound.cpp:(.text+0x78): undefined reference to Mix_PlayChannel' C:\Users\Peaky\AppData\Local\Temp\ccNacBJ2.o:sound.cpp:(.text+0x86): undefined reference to Mix_FreeChunk’
collect2.exe: error: ld returned 1 exit status