TCanvas c1; command not working

Here is a more “official” guide (especially if you are using WSL):

For WSL2, this may work:

Note that, apart from ROOT, you need an X server running on Windows too, as explained in the pages above.