@elextr is right for a proper implementation and I agree this might be of little use for more than simple single file programs.
If needed, you can configure Geany to build your code in the run command. Just tested and works pretty good if you can live to have the compiler output in the terminal used for executing the built code:
Build command configuration: ![build_and_run_config](https://github.com/geany/geany/assets/617017/ee61797f-777e-47a9-ba5c-71a7aab...)
And using the Run command to build and execute the code: ![build_and_run_executed](https://github.com/geany/geany/assets/617017/e00b47e0-b5eb-40d9-9c43-af460e4...)
It's not perfect but might be sufficient.