I need to build a .exe for linux but im using U++ on windows. Is there a way to do this or will I have to install linux?
You have to install linux (in VM perhaps).
Also be warned, things are more complicated, there is nothing like ".exe for Linux". Best you can do is ".exe" for specific linux distribution, like Ubuntu 2021.4 (that is also why U++ ide recompiles on installation).