Failing to link mixer on WSL Ubuntu

I’ve been developing with SDL2 in Windows for quiet a while and am trying to compile in WSL so I can use valgrind.

Here is how my compilation command includes linking and including the necessary library and header filles (with -I libs/SDL2 -L libs/SDL2/lib at the top

image

under libs/SDL2 I have all of the headers:

under libs/SDL2/lib I have the necessary library files:

so I’m not really sure why I get these error when I compile:
/usr/bin/ld: /tmp/ccoNxkIy.o: in function …cpp:61: undefined reference to Mix_LoadWAV
/usr/bin/ld: /tmp/ccoNxkIy.o: in function …cpp:68: undefined reference to Mix_PlayChannel
collect2: error: ld returned 1 exit status

I’m not sure what could be wrong at this point. If any of you have any ideas, please let me know, thanks.

Mix_LoadWAV and Mix_PlayChannel were macros in Mixer 2.0.0, but were later refactored into functions. You are probably using includes (maybe from system installed SDL?) from more recent SDL_mixer. Either update your used SDL_mixer or fix the includes.

I looked at my /usr/include/SDL_mixer.h on my Linux Mint.
I can see that there is a macro there.

#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)

When I switched to dual-booting Ubuntu, compilation worked first try