Images not being displayed in executable

Hi, I have made a game in SDL2.0 and I am using bmp files for the images. The project runs fine when i am building from visual studio but the executable doesn’t show any images when i run it from outside.

I figured it out that it is happening because of the path of the images. I was giving relative path for the images and when i passed the absolute path, things just worked fine but this is not the right solution because I might i have to pass on the project and I would need to send relative path so it doesn’t need to be changed. How am i supposed to achieve this?

The issue is.
While running from VS if i do “…/images/file”, it works but if i cut paste my exe to solution directory, the images won’t load. I want a path that works for both

You can create an absolute path by using SDL_GetBasePath - SDL Wiki (which returns the full path to the directory your executable is in) and then appending your path that’s relative to the executable’s directory to that

Thanks. I think for this i have to change the output directory of my exe