When I compile from the command line I use:
without the leading space.
It looks like you are using an
IDE so I think you need to use an absolution path like your original code (which is not a good idea), or you need to load the image as a resource as explained in the tutorial link I provided you.