import subprocess

def compile_cpp(name, output):
    print("Compiling", name + "...")
    line = ["g++", name, "-o", output, "-O2"]
    code = subprocess.call(line)
    if code != 0:
        print("Error while compiling:", line)
        exit(1)
