@echo off setlocal rem 设置文件夹路径 set "folderPath=.\build" rem 检查文件夹是否存在 if not exist "%folderPath%" ( mkdir "%folderPath%" echo Folder created: %folderPath% ) else ( echo Folder already exists: %folderPath% ) rem 编译C++文件 g++ .\src\main.cpp -o "%folderPath%\tmake.exe" -I.\tomlplusplus -O3 rem 检查编译是否成功 if %errorlevel% equ 0 ( echo Compilation successful. ) else ( echo Compilation failed with error level %errorlevel%. ) endlocal