Compiles a C++ source file using g++. Uses -O2 optimization and C++23 standard.
Path to the .cpp source file
Path to the compiled executable
If file is not .cpp or compilation fails
const executablePath = await compileCPP('solutions/main.cpp');// Returns: '/path/to/solutions/main' Copy
const executablePath = await compileCPP('solutions/main.cpp');// Returns: '/path/to/solutions/main'
Compiles a C++ source file using g++. Uses -O2 optimization and C++23 standard.