You don’t run your executable with gprof, so you only specify it so gprof can load symbols. You run the executable first, on its own just as normal, and it then emits profiling data.
This data is loaded, along with the executable, by gprof later.
This is all explained in the gprof manual, of course.