假如hihovertree.cpp是一个c++程序文件,在Windows系统中已经安装了MinGw编译器,并且设置了环境变量,则可以使用g++再命令提示符中编译c++程序,编译命令如下:
g++ hihovertree.cpp -std=c++14 -o hihovertree.exe
其中
-std=c++14
表示使用C++14标准进行编译。
可以选择的标准包括:
-std=c++98
-std=c++11
-std=c++14
-std=c++17
-std=c++2a
等
其中-std=c++2a有可能表示c++20或c++23标准
以下为hihovertree.cpp的内容:
#include <stdio.h>
int main() {
printf("Hello World! hovertree.com");
return 0;
}