Icon not showing in the Windows taskbar

I’m loading an icon in my Windows SDL app using:

SDL_Surface* pIcon = IMG_Load("icon64.png");
 
if (pIcon != NULL)
{
	SDL_SetWindowIcon(g_Window, pIcon);

	SDL_FreeSurface(pIcon);
}

When I run the app with Visual Studio, or just double click the built .exe, the icon appears in the app’s title bar and in Windows’ taskbar exactly as I’d expect. But, when I package up the app and it is installed to c:\Program Files (x86)\ and run the app from there the icon appears in the title bar but not in the taskbar (it just shows the default icon). Not sure what I’m getting wrong!

I’m using Visual Studio 2017, SDL 2.0.14 and Windows 10

1 Like