Last year, in university we used the library SDL to create a game from scratch. So I though of developping a game engine based on SDL. I will be using Qt to do the UI and SDL to implement the core of the engine (collisons, physics, game logic etc...). The game engine will be a simple application, for example the user creates a new project, adds a player, enemies, objectives... and then when he wants to test the game, the application will create the source code necessary for that game, compiles it and executes it. So my question is how can I compile that code and execute it ? Do I compile externally (with the help of commandes like gcc -c (use of system(), CreateProcess()) or is there another way ? 
Compiling source code using c++
c++