feat: v8.2版本更新 - 编译脚本优化\n\n- 🔧 交互式编译脚本:compile_gui.bat支持选择编译控制台或GUI版本\n- 📋 用户友好界面:提供清晰的编译选项菜单和操作指引\n- 编译流程优化:统一编译参数,解决SDL3依赖问题\n- �� 多语言支持:英文界面避免编码问题,确保兼容性\n- 错误处理完善:添加无效输入处理和详细错误提示\n- 🎯 开发体验提升:简化编译流程,提高开发效率

This commit is contained in:
2025-09-20 11:08:46 +08:00
parent 2121831478
commit ae0629ef6e
4 changed files with 112 additions and 41 deletions
+10 -2
View File
@@ -2,13 +2,21 @@
![Build Status](https://img.shields.io/badge/build-passing-brightgreen)
![License](https://img.shields.io/badge/license-MIT-blue)
![Version](https://img.shields.io/badge/version-v8.0-blue)
![Version](https://img.shields.io/badge/version-v8.2-blue)
![Platform](https://img.shields.io/badge/platform-Windows-lightgrey)
> 🎯 **最新版本 v8.0** - GUI图形化界面更新,实现SDL3图形化界面、现代化用户体验、可视化棋盘操作等重大功能升级
> 🎯 **最新版本 v8.2** - 编译脚本优化更新,完善批处理脚本功能、增强用户编译体验、优化开发工作流程
## 📋 大版本更新
### v8.2 (2025-01-20) - 编译脚本优化更新
- 🔧 **交互式编译脚本** - compile_gui.bat支持选择编译控制台或GUI版本
- 📋 **用户友好界面** - 提供清晰的编译选项菜单和操作指引
-**编译流程优化** - 统一编译参数,解决SDL3依赖问题
- 🌐 **多语言支持** - 英文界面避免编码问题,确保兼容性
-**错误处理完善** - 添加无效输入处理和详细错误提示
- 🎯 **开发体验提升** - 简化编译流程,提高开发效率
### v8.0 (2025-01-18) - GUI图形化界面更新
- 🖥️ **SDL3图形化界面** - 全新的现代化图形用户界面
- 🎮 **可视化棋盘操作** - 支持鼠标点击落子和直观的棋盘显示
+99
View File
@@ -0,0 +1,99 @@
@echo off
echo ===== Gobang Game Compile Script =====
echo.
echo Please select compile version:
echo 1. Console version (gobang_console.exe)
echo 2. GUI version (gobang_gui.exe)
echo 3. Compile all versions
echo 0. Exit
echo.
set /p choice="Please enter your choice (0-3): "
if "%choice%"=="0" goto :exit
if "%choice%"=="1" goto :console
if "%choice%"=="2" goto :gui
if "%choice%"=="3" goto :all
echo Invalid choice!
pause
exit /b 1
:console
echo.
echo Compiling console version...
echo.
gcc -std=c17 -o gobang_console.exe *.c -ID:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include -LD:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\lib -lSDL3 -lws2_32
if %ERRORLEVEL% EQU 0 (
echo.
echo Compilation successful! Generated: gobang_console.exe
echo Run command: .\gobang_console.exe
echo.
) else (
echo.
echo Compilation failed! Please check source files and compiler installation
echo.
)
goto :end
:gui
echo.
echo Compiling GUI version...
echo.
REM Check if SDL3 library exists
if not exist "D:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include" (
echo Error: SDL3 library not found!
echo Please ensure SDL3 is extracted to: D:\settings\SDL\SDL3-3.2.22\
goto :end
)
gcc -std=c17 -o gobang_gui.exe *.c -ID:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include -LD:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\lib -lSDL3 -lws2_32
if %ERRORLEVEL% EQU 0 (
echo.
echo Compilation successful! Generated: gobang_gui.exe
echo.
echo Copying SDL3.dll to current directory...
copy "D:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\bin\SDL3.dll" . >nul 2>&1
echo Run command: .\gobang_gui.exe
echo.
) else (
echo.
echo Compilation failed! Please check:
echo 1. SDL3 library path is correct
echo 2. All source files exist
echo 3. gcc compiler is installed
echo.
)
goto :end
:all
echo.
echo Compiling all versions...
echo.
echo [1/2] Compiling console version...
gcc -std=c17 -o gobang_console.exe *.c -ID:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include -LD:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\lib -lSDL3 -lws2_32
if %ERRORLEVEL% EQU 0 (
echo Console version compilation successful!
) else (
echo Console version compilation failed!
)
echo.
echo [2/2] Compiling GUI version...
if not exist "D:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include" (
echo Error: SDL3 library not found! Skipping GUI version compilation
goto :end
)
gcc -std=c17 -o gobang_gui.exe *.c -ID:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include -LD:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\lib -lSDL3 -lws2_32
if %ERRORLEVEL% EQU 0 (
echo GUI version compilation successful!
copy "D:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\bin\SDL3.dll" . >nul 2>&1
) else (
echo GUI version compilation failed!
)
echo.
echo Compilation complete! Generated files:
dir *.exe 2>nul
echo.
goto :end
:end
pause
:exit
-36
View File
@@ -1,36 +0,0 @@
@echo off
chcp 65001 >nul
echo Compiling Gobang GUI version...
echo.
REM Check if SDL3 library exists
if not exist "D:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include" (
echo Error: SDL3 library not found!
echo Please ensure SDL3 is extracted to: D:\settings\SDL\SDL3-3.2.22\
pause
exit /b 1
)
REM Compile GUI version
gcc -std=c17 -o gobang_gui.exe *.c -ID:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include -LD:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\lib -lSDL3 -lws2_32
if %ERRORLEVEL% EQU 0 (
echo.
echo Compilation successful! Generated: gobang_gui.exe
echo.
echo Copy SDL3.dll to current directory...
copy "D:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\bin\SDL3.dll" .
echo.
echo Run GUI version:
echo .\gobang_gui.exe
echo.
) else (
echo.
echo Compilation failed! Please check:
echo 1. SDL3 library path is correct
echo 2. All source files exist
echo 3. gcc compiler is installed
echo.
)
pause
+2 -2
View File
@@ -5,8 +5,8 @@
* @brief 将以下指令复制到powershell
*
* !控制台版本编译:
* gcc -std=c17 -o gobang.exe *.c -lws2_32
.\gobang.exe
* gcc -std=c17 -o gobang_console.exe *.c -lws2_32
.\gobang_console.exe
*
* !图形化版本编译(需要SDL3):
* gcc -std=c17 -o gobang_gui.exe *.c -ID:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\include -LD:\settings\SDL\SDL3-3.2.22\x86_64-w64-mingw32\lib -lSDL3 -lws2_32