Compile C++ from terminal in Linux

Is there any way to compile my cpp code from terminal without starting the EU4?

I’ve found this answer in the forums but I am not sure this is the right and only way.